diff --git a/.fastlane/Fastfile b/.fastlane/Fastfile index 4d3d55b..7538cc3 100644 --- a/.fastlane/Fastfile +++ b/.fastlane/Fastfile @@ -1,14 +1,11 @@ lane :test_ios do - carthage(platform: "iOS") - scan(scheme: "Money", destination: "platform=iOS Simulator,OS=10.0,name=iPhone 6s") + scan(scheme: "Money", destination: "platform=iOS Simulator,OS=11.0,name=iPhone 8") end lane :test_mac do - carthage(platform: "Mac") - scan(scheme: "Money", destination: "platform=macOS") + scan(scheme: "Money", destination: "platform=macOS") end lane :test_tvos do - carthage(platform: "tvOS") - scan(scheme: "Money", destination: "platform=tvOS Simulator,OS=10.0,name=Apple TV 1080p") + scan(scheme: "Money", destination: "platform=tvOS Simulator,OS=11.0,name=Apple TV") end diff --git a/Cartfile b/Cartfile deleted file mode 100644 index 8346379..0000000 --- a/Cartfile +++ /dev/null @@ -1 +0,0 @@ -github "danthorpe/ValueCoding" "2.1.0" diff --git a/Cartfile.resolved b/Cartfile.resolved deleted file mode 100644 index 8346379..0000000 --- a/Cartfile.resolved +++ /dev/null @@ -1 +0,0 @@ -github "danthorpe/ValueCoding" "2.1.0" diff --git a/Money.xcodeproj/project.pbxproj b/Money.xcodeproj/project.pbxproj index becee0e..d5edea9 100644 --- a/Money.xcodeproj/project.pbxproj +++ b/Money.xcodeproj/project.pbxproj @@ -21,59 +21,45 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 655155121DB3D50700368D35 /* ApplePay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155111DB3D50700368D35 /* ApplePay.swift */; }; - 6551551F1DB3D59900368D35 /* ApplePayTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155151DB3D59900368D35 /* ApplePayTests.swift */; }; - 655155201DB3D59900368D35 /* AutogeneratedTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155161DB3D59900368D35 /* AutogeneratedTests.swift */; }; - 655155211DB3D59900368D35 /* BitcoinTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155171DB3D59900368D35 /* BitcoinTests.swift */; }; - 655155221DB3D59900368D35 /* DecimalNumberTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155181DB3D59900368D35 /* DecimalNumberTypeTests.swift */; }; - 655155231DB3D59900368D35 /* DecimalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 655155191DB3D59900368D35 /* DecimalTests.swift */; }; - 655155251DB3D59900368D35 /* LocaleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6551551B1DB3D59900368D35 /* LocaleTests.swift */; }; - 655155261DB3D59900368D35 /* MoneyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6551551C1DB3D59900368D35 /* MoneyTests.swift */; }; - 655155271DB3D59900368D35 /* NSDecimalNumberTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6551551D1DB3D59900368D35 /* NSDecimalNumberTests.swift */; }; - 655155281DB3D59900368D35 /* NSDecimalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6551551E1DB3D59900368D35 /* NSDecimalTests.swift */; }; 65599E7D1DB3D17F00EC123C /* Money.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65599E721DB3D17E00EC123C /* Money.framework */; }; - 65599E951DB3D2D500EC123C /* Autogenerated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E8B1DB3D2D500EC123C /* Autogenerated.swift */; }; - 65599E961DB3D2D500EC123C /* Bitcoin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E8C1DB3D2D500EC123C /* Bitcoin.swift */; }; - 65599E971DB3D2D500EC123C /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E8D1DB3D2D500EC123C /* Currency.swift */; }; - 65599E981DB3D2D500EC123C /* Decimal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E8E1DB3D2D500EC123C /* Decimal.swift */; }; - 65599E991DB3D2D500EC123C /* DecimalNumberType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E8F1DB3D2D500EC123C /* DecimalNumberType.swift */; }; - 65599E9A1DB3D2D500EC123C /* Locale.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E901DB3D2D500EC123C /* Locale.swift */; }; - 65599E9B1DB3D2D500EC123C /* Money.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E911DB3D2D500EC123C /* Money.swift */; }; - 65599E9C1DB3D2D500EC123C /* NSDecimalExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E921DB3D2D500EC123C /* NSDecimalExtensions.swift */; }; - 65599E9D1DB3D2D500EC123C /* NSDecimalNumberExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65599E931DB3D2D500EC123C /* NSDecimalNumberExtensions.swift */; }; + 657FA52E1F6C7DF6005B0CE9 /* ISOMoney.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA5291F6C7DF6005B0CE9 /* ISOMoney.swift */; }; + 657FA52F1F6C7DF6005B0CE9 /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA52A1F6C7DF6005B0CE9 /* Currency.swift */; }; + 657FA5301F6C7DF6005B0CE9 /* MoneyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA52B1F6C7DF6005B0CE9 /* MoneyProtocol.swift */; }; + 657FA5311F6C7DF6005B0CE9 /* Money.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA52C1F6C7DF6005B0CE9 /* Money.swift */; }; + 657FA5321F6C7DF6005B0CE9 /* CurrencyProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA52D1F6C7DF6005B0CE9 /* CurrencyProtocol.swift */; }; + 657FA5351F6C7E02005B0CE9 /* InitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA5331F6C7E02005B0CE9 /* InitTests.swift */; }; + 657FA5361F6C7E02005B0CE9 /* MoneyTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA5341F6C7E02005B0CE9 /* MoneyTestCase.swift */; }; + 657FA5381F6C80FA005B0CE9 /* AdditionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA5371F6C80FA005B0CE9 /* AdditionTests.swift */; }; + 657FA53A1F6C8114005B0CE9 /* SubtractionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA5391F6C8114005B0CE9 /* SubtractionTests.swift */; }; + 657FA53C1F6C811F005B0CE9 /* MultiplicationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA53B1F6C811F005B0CE9 /* MultiplicationTests.swift */; }; + 657FA53E1F6C812C005B0CE9 /* ComparisonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 657FA53D1F6C812C005B0CE9 /* ComparisonTests.swift */; }; + 65DDE2451F72F8D000E88DEC /* DivisionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65DDE2441F72F8D000E88DEC /* DivisionTests.swift */; }; + 65DDE2471F7305F000E88DEC /* Decimal+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65DDE2461F7305F000E88DEC /* Decimal+Extensions.swift */; }; + 65DDE24B1F73148900E88DEC /* Autogenerated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65DDE24A1F73148800E88DEC /* Autogenerated.swift */; }; + 65DDE24D1F73224500E88DEC /* NSLocale+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65DDE24C1F73224500E88DEC /* NSLocale+Extensions.swift */; }; 65ECB2B11DB3DC9900F96F46 /* Money.h in Headers */ = {isa = PBXBuildFile; fileRef = 65599E6A1DB3CFD300EC123C /* Money.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 65FD575B1F77F11F001C066C /* MoneyFormattingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FD575A1F77F11F001C066C /* MoneyFormattingTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 652899911DB3D96B0099D541 /* PBXContainerItemProxy */ = { + 65599E7E1DB3D17F00EC123C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 65599E611DB3CF2E00EC123C /* Project object */; proxyType = 1; - remoteGlobalIDString = 65687D5B1DB3D8B70016FB31; - remoteInfo = "Generate Swift"; + remoteGlobalIDString = 65599E711DB3D17E00EC123C; + remoteInfo = Money; }; - 65599E7E1DB3D17F00EC123C /* PBXContainerItemProxy */ = { + 65DDE2481F73133000E88DEC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 65599E611DB3CF2E00EC123C /* Project object */; proxyType = 1; - remoteGlobalIDString = 65599E711DB3D17E00EC123C; - remoteInfo = Money; + remoteGlobalIDString = 65687D5B1DB3D8B70016FB31; + remoteInfo = "Generate Swift"; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 655155101DB3D45100368D35 /* Carthage.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Carthage.xcconfig; sourceTree = ""; }; - 655155111DB3D50700368D35 /* ApplePay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApplePay.swift; sourceTree = ""; }; - 655155151DB3D59900368D35 /* ApplePayTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApplePayTests.swift; sourceTree = ""; }; - 655155161DB3D59900368D35 /* AutogeneratedTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutogeneratedTests.swift; sourceTree = ""; }; - 655155171DB3D59900368D35 /* BitcoinTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BitcoinTests.swift; sourceTree = ""; }; - 655155181DB3D59900368D35 /* DecimalNumberTypeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecimalNumberTypeTests.swift; sourceTree = ""; }; - 655155191DB3D59900368D35 /* DecimalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecimalTests.swift; sourceTree = ""; }; 6551551A1DB3D59900368D35 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6551551B1DB3D59900368D35 /* LocaleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocaleTests.swift; sourceTree = ""; }; - 6551551C1DB3D59900368D35 /* MoneyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyTests.swift; sourceTree = ""; }; - 6551551D1DB3D59900368D35 /* NSDecimalNumberTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDecimalNumberTests.swift; sourceTree = ""; }; - 6551551E1DB3D59900368D35 /* NSDecimalTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDecimalTests.swift; sourceTree = ""; }; 65599E681DB3CFD300EC123C /* Generate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Generate.swift; sourceTree = ""; }; 65599E691DB3CFD300EC123C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65599E6A1DB3CFD300EC123C /* Money.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Money.h; sourceTree = ""; }; @@ -81,18 +67,25 @@ 65599E6C1DB3CFD300EC123C /* Version.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = ""; }; 65599E721DB3D17E00EC123C /* Money.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Money.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 65599E7C1DB3D17F00EC123C /* MoneyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MoneyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 65599E8B1DB3D2D500EC123C /* Autogenerated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Autogenerated.swift; sourceTree = ""; }; - 65599E8C1DB3D2D500EC123C /* Bitcoin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bitcoin.swift; sourceTree = ""; }; - 65599E8D1DB3D2D500EC123C /* Currency.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Currency.swift; sourceTree = ""; }; - 65599E8E1DB3D2D500EC123C /* Decimal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Decimal.swift; sourceTree = ""; }; - 65599E8F1DB3D2D500EC123C /* DecimalNumberType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DecimalNumberType.swift; sourceTree = ""; }; - 65599E901DB3D2D500EC123C /* Locale.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Locale.swift; sourceTree = ""; }; - 65599E911DB3D2D500EC123C /* Money.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Money.swift; sourceTree = ""; }; - 65599E921DB3D2D500EC123C /* NSDecimalExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDecimalExtensions.swift; sourceTree = ""; }; - 65599E931DB3D2D500EC123C /* NSDecimalNumberExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDecimalNumberExtensions.swift; sourceTree = ""; }; + 657FA5291F6C7DF6005B0CE9 /* ISOMoney.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ISOMoney.swift; sourceTree = ""; }; + 657FA52A1F6C7DF6005B0CE9 /* Currency.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Currency.swift; sourceTree = ""; }; + 657FA52B1F6C7DF6005B0CE9 /* MoneyProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyProtocol.swift; sourceTree = ""; }; + 657FA52C1F6C7DF6005B0CE9 /* Money.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Money.swift; sourceTree = ""; }; + 657FA52D1F6C7DF6005B0CE9 /* CurrencyProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyProtocol.swift; sourceTree = ""; }; + 657FA5331F6C7E02005B0CE9 /* InitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InitTests.swift; sourceTree = ""; }; + 657FA5341F6C7E02005B0CE9 /* MoneyTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyTestCase.swift; sourceTree = ""; }; + 657FA5371F6C80FA005B0CE9 /* AdditionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionTests.swift; sourceTree = ""; }; + 657FA5391F6C8114005B0CE9 /* SubtractionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubtractionTests.swift; sourceTree = ""; }; + 657FA53B1F6C811F005B0CE9 /* MultiplicationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiplicationTests.swift; sourceTree = ""; }; + 657FA53D1F6C812C005B0CE9 /* ComparisonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComparisonTests.swift; sourceTree = ""; }; 65AA39ED1DFEF418000942A7 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 65DDE2441F72F8D000E88DEC /* DivisionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DivisionTests.swift; sourceTree = ""; }; + 65DDE2461F7305F000E88DEC /* Decimal+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Decimal+Extensions.swift"; sourceTree = ""; }; + 65DDE24A1F73148800E88DEC /* Autogenerated.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Autogenerated.swift; sourceTree = ""; }; + 65DDE24C1F73224500E88DEC /* NSLocale+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSLocale+Extensions.swift"; sourceTree = ""; }; 65ECB2BF1DB4134C00F96F46 /* Autogenerate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Autogenerate.h; sourceTree = ""; }; 65ECB2C01DB4134C00F96F46 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 65FD575A1F77F11F001C066C /* MoneyFormattingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoneyFormattingTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -127,15 +120,14 @@ isa = PBXGroup; children = ( 6551551A1DB3D59900368D35 /* Info.plist */, - 655155151DB3D59900368D35 /* ApplePayTests.swift */, - 655155161DB3D59900368D35 /* AutogeneratedTests.swift */, - 655155171DB3D59900368D35 /* BitcoinTests.swift */, - 655155181DB3D59900368D35 /* DecimalNumberTypeTests.swift */, - 655155191DB3D59900368D35 /* DecimalTests.swift */, - 6551551B1DB3D59900368D35 /* LocaleTests.swift */, - 6551551C1DB3D59900368D35 /* MoneyTests.swift */, - 6551551D1DB3D59900368D35 /* NSDecimalNumberTests.swift */, - 6551551E1DB3D59900368D35 /* NSDecimalTests.swift */, + 657FA5371F6C80FA005B0CE9 /* AdditionTests.swift */, + 657FA53D1F6C812C005B0CE9 /* ComparisonTests.swift */, + 65DDE2441F72F8D000E88DEC /* DivisionTests.swift */, + 657FA5331F6C7E02005B0CE9 /* InitTests.swift */, + 65FD575A1F77F11F001C066C /* MoneyFormattingTests.swift */, + 657FA5341F6C7E02005B0CE9 /* MoneyTestCase.swift */, + 657FA53B1F6C811F005B0CE9 /* MultiplicationTests.swift */, + 657FA5391F6C8114005B0CE9 /* SubtractionTests.swift */, ); path = Tests; sourceTree = ""; @@ -156,7 +148,6 @@ 65599E6A1DB3CFD300EC123C /* Money.h */, 65599E691DB3CFD300EC123C /* Info.plist */, 65599E681DB3CFD300EC123C /* Generate.swift */, - 655155101DB3D45100368D35 /* Carthage.xcconfig */, 65599E6B1DB3CFD300EC123C /* Money.xcconfig */, 65599E6C1DB3CFD300EC123C /* Version.xcconfig */, 65AA39ED1DFEF418000942A7 /* Warnings.xcconfig */, @@ -176,16 +167,14 @@ 65599E8A1DB3D2D500EC123C /* Sources */ = { isa = PBXGroup; children = ( - 655155111DB3D50700368D35 /* ApplePay.swift */, - 65599E8B1DB3D2D500EC123C /* Autogenerated.swift */, - 65599E8C1DB3D2D500EC123C /* Bitcoin.swift */, - 65599E8D1DB3D2D500EC123C /* Currency.swift */, - 65599E8E1DB3D2D500EC123C /* Decimal.swift */, - 65599E8F1DB3D2D500EC123C /* DecimalNumberType.swift */, - 65599E901DB3D2D500EC123C /* Locale.swift */, - 65599E911DB3D2D500EC123C /* Money.swift */, - 65599E921DB3D2D500EC123C /* NSDecimalExtensions.swift */, - 65599E931DB3D2D500EC123C /* NSDecimalNumberExtensions.swift */, + 65DDE24A1F73148800E88DEC /* Autogenerated.swift */, + 657FA52A1F6C7DF6005B0CE9 /* Currency.swift */, + 657FA52D1F6C7DF6005B0CE9 /* CurrencyProtocol.swift */, + 657FA5291F6C7DF6005B0CE9 /* ISOMoney.swift */, + 657FA52C1F6C7DF6005B0CE9 /* Money.swift */, + 657FA52B1F6C7DF6005B0CE9 /* MoneyProtocol.swift */, + 65DDE2461F7305F000E88DEC /* Decimal+Extensions.swift */, + 65DDE24C1F73224500E88DEC /* NSLocale+Extensions.swift */, ); path = Sources; sourceTree = ""; @@ -225,7 +214,7 @@ buildRules = ( ); dependencies = ( - 652899921DB3D96B0099D541 /* PBXTargetDependency */, + 65DDE2491F73133000E88DEC /* PBXTargetDependency */, ); name = Money; productName = Money; @@ -239,7 +228,6 @@ 65599E781DB3D17F00EC123C /* Sources */, 65599E791DB3D17F00EC123C /* Frameworks */, 65599E7A1DB3D17F00EC123C /* Resources */, - 65ECB2B21DB3DD9F00F96F46 /* Copy Carthage Frameworks */, ); buildRules = ( ); @@ -262,10 +250,11 @@ TargetAttributes = { 65599E711DB3D17E00EC123C = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 65599E7B1DB3D17F00EC123C = { CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0900; }; 65687D5B1DB3D8B70016FB31 = { CreatedOnToolsVersion = 7.3.1; @@ -327,22 +316,6 @@ shellScript = "\"$SCRIPT_INPUT_FILE_0\" \"$SCRIPT_OUTPUT_FILE_0\" \"$SCRIPT_OUTPUT_FILE_1\""; showEnvVarsInLog = 0; }; - 65ECB2B21DB3DD9F00F96F46 /* Copy Carthage Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ValueCoding, - ); - name = "Copy Carthage Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "case \"$PLATFORM_NAME\" in\nmacosx) plat=Mac;;\niphone*) plat=iOS;;\nwatch*) plat=watchOS;;\nappletv*) plat=tvOS;;\n*) echo \"error: Unknown PLATFORM_NAME: $PLATFORM_NAME\"; exit 1;;\nesac\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nframework=$(basename \"${!VAR}\")\nexport SCRIPT_INPUT_FILE_$n=\"$SRCROOT\"/Carthage/Build/$plat/\"$framework\".framework\ndone\n\n/usr/local/bin/carthage copy-frameworks || exit\n\nfor (( n = 0; n < SCRIPT_INPUT_FILE_COUNT; n++ )); do\nVAR=SCRIPT_INPUT_FILE_$n\nsource=${!VAR}.dSYM\ndest=${BUILT_PRODUCTS_DIR}/$(basename \"$source\")\nditto \"$source\" \"$dest\" || exit\ndone"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -350,16 +323,14 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 65599E971DB3D2D500EC123C /* Currency.swift in Sources */, - 65599E9D1DB3D2D500EC123C /* NSDecimalNumberExtensions.swift in Sources */, - 65599E961DB3D2D500EC123C /* Bitcoin.swift in Sources */, - 65599E9B1DB3D2D500EC123C /* Money.swift in Sources */, - 65599E991DB3D2D500EC123C /* DecimalNumberType.swift in Sources */, - 65599E9C1DB3D2D500EC123C /* NSDecimalExtensions.swift in Sources */, - 65599E951DB3D2D500EC123C /* Autogenerated.swift in Sources */, - 65599E981DB3D2D500EC123C /* Decimal.swift in Sources */, - 655155121DB3D50700368D35 /* ApplePay.swift in Sources */, - 65599E9A1DB3D2D500EC123C /* Locale.swift in Sources */, + 65DDE24D1F73224500E88DEC /* NSLocale+Extensions.swift in Sources */, + 65DDE24B1F73148900E88DEC /* Autogenerated.swift in Sources */, + 657FA5301F6C7DF6005B0CE9 /* MoneyProtocol.swift in Sources */, + 657FA52F1F6C7DF6005B0CE9 /* Currency.swift in Sources */, + 657FA5321F6C7DF6005B0CE9 /* CurrencyProtocol.swift in Sources */, + 65DDE2471F7305F000E88DEC /* Decimal+Extensions.swift in Sources */, + 657FA5311F6C7DF6005B0CE9 /* Money.swift in Sources */, + 657FA52E1F6C7DF6005B0CE9 /* ISOMoney.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -367,31 +338,30 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 655155231DB3D59900368D35 /* DecimalTests.swift in Sources */, - 655155271DB3D59900368D35 /* NSDecimalNumberTests.swift in Sources */, - 655155221DB3D59900368D35 /* DecimalNumberTypeTests.swift in Sources */, - 655155211DB3D59900368D35 /* BitcoinTests.swift in Sources */, - 655155201DB3D59900368D35 /* AutogeneratedTests.swift in Sources */, - 6551551F1DB3D59900368D35 /* ApplePayTests.swift in Sources */, - 655155251DB3D59900368D35 /* LocaleTests.swift in Sources */, - 655155281DB3D59900368D35 /* NSDecimalTests.swift in Sources */, - 655155261DB3D59900368D35 /* MoneyTests.swift in Sources */, + 657FA53E1F6C812C005B0CE9 /* ComparisonTests.swift in Sources */, + 657FA5361F6C7E02005B0CE9 /* MoneyTestCase.swift in Sources */, + 657FA5381F6C80FA005B0CE9 /* AdditionTests.swift in Sources */, + 65DDE2451F72F8D000E88DEC /* DivisionTests.swift in Sources */, + 657FA53C1F6C811F005B0CE9 /* MultiplicationTests.swift in Sources */, + 65FD575B1F77F11F001C066C /* MoneyFormattingTests.swift in Sources */, + 657FA53A1F6C8114005B0CE9 /* SubtractionTests.swift in Sources */, + 657FA5351F6C7E02005B0CE9 /* InitTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 652899921DB3D96B0099D541 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 65687D5B1DB3D8B70016FB31 /* Generate Swift */; - targetProxy = 652899911DB3D96B0099D541 /* PBXContainerItemProxy */; - }; 65599E7F1DB3D17F00EC123C /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 65599E711DB3D17E00EC123C /* Money */; targetProxy = 65599E7E1DB3D17F00EC123C /* PBXContainerItemProxy */; }; + 65DDE2491F73133000E88DEC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 65687D5B1DB3D8B70016FB31 /* Generate Swift */; + targetProxy = 65DDE2481F73133000E88DEC /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -459,6 +429,7 @@ MTL_ENABLE_DEBUG_INFO = YES; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -504,6 +475,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; SKIP_INSTALL = YES; + SWIFT_VERSION = 3.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -512,6 +484,7 @@ 65599E861DB3D17F00EC123C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -548,9 +521,11 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 10.0; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; @@ -559,6 +534,7 @@ 65599E871DB3D17F00EC123C /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; @@ -589,8 +565,10 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = NO; + SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 10.0; WATCHOS_DEPLOYMENT_TARGET = 3.0; }; diff --git a/Money.xcodeproj/xcshareddata/IDETemplateMacros.plist b/Money.xcodeproj/xcshareddata/IDETemplateMacros.plist new file mode 100644 index 0000000..97d8029 --- /dev/null +++ b/Money.xcodeproj/xcshareddata/IDETemplateMacros.plist @@ -0,0 +1,16 @@ + + + + + FILEHEADER + +// ___PROJECTNAME___ +// File created on ___DATE___. +// +// Copyright (c) 2015-___YEAR___ Daniel Thorpe +// +// ___PROJECTNAME___ is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + + diff --git a/Sources/ApplePay.swift b/Sources/ApplePay.swift deleted file mode 100644 index f8c38e2..0000000 --- a/Sources/ApplePay.swift +++ /dev/null @@ -1,228 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) - -import Foundation -import PassKit -import ValueCoding - -// MARK: - Pay equivalent types - -/** - - # PaymentSummaryItemType - - An equivalent `PKPaymentSummaryItemType` enum. While defined - for iOS 8, usage will only have an impact on iOS 9. - - - see: PKPaymentSummaryItemType - */ -public enum PaymentSummaryItemType: Int { - case final = 1, pending -} - -/** - - # PaymentSummaryItem - - A value type to represent a payment line item. It is generic over the - `MoneyType` of the item cost. Other properties are a label and type. - - The money type must use `NSDecimalNumber` storage type, and correctly - conform to `ValueCoding`. - */ -public struct PaymentSummaryItem: Hashable, ValueCoding where Cost.DecimalStorageType == NSDecimalNumber, Cost.Coder: NSCoding, Cost.Coder.Value == Cost { - - /// The ValueCoding Coder type - public typealias Coder = PaymentSummaryItemCoder - - /** - A label for the item. - - returns: a `String` value - */ - public let label: String - - /** - The cost of the item. - - returns: a `Cost` value - */ - public let cost: Cost - - /** - The cost type of the item. See docs for - `PKPaymentSummaryItemType`. - - returns: a `PaymentSummaryItemType` value - */ - public let type: PaymentSummaryItemType - - internal var amount: Cost.DecimalStorageType { - return cost.amount - } - - public var hashValue: Int { - return cost.hashValue ^ (label.hashValue ^ type.hashValue) - } - - /** - Create a new `PaymentSummaryItem` with a cost, label and type. - - - discussion: As per the documentation of `PKPaymentSummaryItem` use - a `.Pending` item type, for when the final value is not known - yet, e.g. a taxi fare. In which case, the cost should be zero. On iOS - 9 we will automaticaly set the cost to zero for pending type. - - - parameter label: the value for the `label` property. - - parameter cost: the value for the `cost` property. - - parameter type: the value for the `type` property. - - returns: a summary item with a given label, cost and type. - */ - public init(label: String, cost: Cost, type: PaymentSummaryItemType = .final) { - self.label = label - self.type = type - switch type { - case .final: - self.cost = cost - case .pending: - self.cost = 0 - } - } -} - -extension PaymentSummaryItem { - - /** - Immutable setter for `label` property - - parameter newLabel: the value for the `label` property in an item copy - - returns: a summary item with a new label value, and previously set cost and type. - */ - public func set(label newLabel: String) -> PaymentSummaryItem { - return PaymentSummaryItem(label: newLabel, cost: cost, type: type) - } - - /** - Immutable setter for `cost` property - - parameter newCost: the value for the `cost` property in an item copy - - returns: a summary item with a new cost value, and previously set label and type. - */ - public func set(cost newCost: Cost) -> PaymentSummaryItem { - return PaymentSummaryItem(label: label, cost: newCost, type: type) - } - - /** - Immutable setter for `type` property - - parameter newType: the value for the `type` property in an item copy - - returns: a summary item with a new type value, and previously set label and cost. - */ - public func set(type newType: PaymentSummaryItemType) -> PaymentSummaryItem { - return PaymentSummaryItem(label: label, cost: cost, type: newType) - } -} - -/** - Coding adaptor for `PaymentSummaryItem`. -*/ -public final class PaymentSummaryItemCoder: NSObject, NSCoding, CodingProtocol where Cost.DecimalStorageType == NSDecimalNumber, Cost.Coder: NSCoding, Cost.Coder.Value == Cost { - - public let value: PaymentSummaryItem - - public required init(_ v: PaymentSummaryItem) { - value = v - } - - public init?(coder aDecoder: NSCoder) { - let cost = Cost.decode(aDecoder.decodeObject(forKey: "cost") as AnyObject?) - let label = aDecoder.decodeObject(forKey: "label") as? String - let type = PaymentSummaryItemType(rawValue: aDecoder.decodeInteger(forKey: "type")) - value = PaymentSummaryItem(label: label!, cost: cost!, type: type!) - } - - public func encode(with aCoder: NSCoder) { - aCoder.encode(value.label, forKey: "label") - aCoder.encode(value.cost.encoded, forKey: "cost") - aCoder.encode(value.type.rawValue, forKey: "type") - } -} - -// MARK: - Pay type extensions - -@available(iOS 9.0, iOSApplicationExtension 9.0, *) -internal extension PKPaymentSummaryItemType { - - init(paymentSummaryItemType: PaymentSummaryItemType) { - switch paymentSummaryItemType { - case .final: - self = .final - case .pending: - self = .pending - } - } -} - -internal extension PKPaymentSummaryItem { - - convenience init(paymentSummaryItem: PaymentSummaryItem) where Cost.DecimalStorageType == NSDecimalNumber { - self.init() - amount = paymentSummaryItem.amount - label = paymentSummaryItem.label - if #available(iOS 9.0, iOSApplicationExtension 9.0, *) { - type = PKPaymentSummaryItemType(paymentSummaryItemType: paymentSummaryItem.type) - } - } -} - -public extension PKPaymentRequest { - - /** - Create a payment request with a sequence of `PaymentSummaryItem`s. The - currency code will automatically be set. - - As per the guidlines the total cost is calculated and appended to the - end of the list, using your company or seller name as the label. - - - see: [guideline](https://developer.apple.com/library/ios/ApplePay_Guide/CreateRequest.html) - - - parameter items: an array of `PaymentSummaryItem` values. - - parameter sellerName: a `String` which is used in the total cost summary item. - - returns: a `PKPaymentRequest` which has its payment summary items and currency code set. - */ - convenience init(items: [PaymentSummaryItem], sellerName: String) where Cost.DecimalStorageType == NSDecimalNumber, Cost.Coder: NSCoding, Cost.Coder.Value == Cost { - self.init() - currencyCode = Cost.Currency.code - var items = items - let total = items.map { $0.cost }.reduce(0, +) - items.append(PaymentSummaryItem(label: sellerName, cost: total)) - paymentSummaryItems = items.map { PKPaymentSummaryItem(paymentSummaryItem: $0) } - } -} - -// MARK: - Equality - -public func ==(lhs: PaymentSummaryItem, rhs: PaymentSummaryItem) -> Bool where Cost.DecimalStorageType == NSDecimalNumber { - return lhs.cost == rhs.cost && lhs.label == rhs.label && lhs.type == rhs.type -} - -#endif diff --git a/Sources/Autogenerated.swift b/Sources/Autogenerated.swift index a214e6b..6c3ed20 100644 --- a/Sources/Autogenerated.swift +++ b/Sources/Autogenerated.swift @@ -1,5940 +1,2710 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// +// +// Money +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// // Autogenerated from build scripts, do not manually edit this file. +// + +// MARK: - Currencies extension Currency { - /// Currency ADP - public final class ADP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ADP - public static var sharedInstance = ADP(code: "ADP") - } - - /// Currency AED - public final class AED: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AED - public static var sharedInstance = AED(code: "AED") - } - - /// Currency AFA - public final class AFA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AFA - public static var sharedInstance = AFA(code: "AFA") - } - - /// Currency AFN - public final class AFN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AFN - public static var sharedInstance = AFN(code: "AFN") - } - - /// Currency ALK - public final class ALK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ALK - public static var sharedInstance = ALK(code: "ALK") - } - - /// Currency ALL - public final class ALL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ALL - public static var sharedInstance = ALL(code: "ALL") - } - - /// Currency AMD - public final class AMD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AMD - public static var sharedInstance = AMD(code: "AMD") - } - - /// Currency ANG - public final class ANG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ANG - public static var sharedInstance = ANG(code: "ANG") - } - - /// Currency AOA - public final class AOA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AOA - public static var sharedInstance = AOA(code: "AOA") - } - - /// Currency AOK - public final class AOK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AOK - public static var sharedInstance = AOK(code: "AOK") - } - - /// Currency AON - public final class AON: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AON - public static var sharedInstance = AON(code: "AON") - } - - /// Currency AOR - public final class AOR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AOR - public static var sharedInstance = AOR(code: "AOR") - } - - /// Currency ARA - public final class ARA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ARA - public static var sharedInstance = ARA(code: "ARA") - } - - /// Currency ARL - public final class ARL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ARL - public static var sharedInstance = ARL(code: "ARL") - } - - /// Currency ARM - public final class ARM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ARM - public static var sharedInstance = ARM(code: "ARM") - } - - /// Currency ARP - public final class ARP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ARP - public static var sharedInstance = ARP(code: "ARP") - } - - /// Currency ARS - public final class ARS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ARS - public static var sharedInstance = ARS(code: "ARS") - } - - /// Currency ATS - public final class ATS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ATS - public static var sharedInstance = ATS(code: "ATS") - } - - /// Currency AUD - public final class AUD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AUD - public static var sharedInstance = AUD(code: "AUD") - } - - /// Currency AWG - public final class AWG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AWG - public static var sharedInstance = AWG(code: "AWG") - } - - /// Currency AZM - public final class AZM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AZM - public static var sharedInstance = AZM(code: "AZM") - } - - /// Currency AZN - public final class AZN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.AZN - public static var sharedInstance = AZN(code: "AZN") - } - - /// Currency BAD - public final class BAD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BAD - public static var sharedInstance = BAD(code: "BAD") - } - - /// Currency BAM - public final class BAM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BAM - public static var sharedInstance = BAM(code: "BAM") - } - - /// Currency BAN - public final class BAN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BAN - public static var sharedInstance = BAN(code: "BAN") - } - - /// Currency BBD - public final class BBD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BBD - public static var sharedInstance = BBD(code: "BBD") - } - - /// Currency BDT - public final class BDT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BDT - public static var sharedInstance = BDT(code: "BDT") - } - - /// Currency BEC - public final class BEC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BEC - public static var sharedInstance = BEC(code: "BEC") - } - - /// Currency BEF - public final class BEF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BEF - public static var sharedInstance = BEF(code: "BEF") - } - - /// Currency BEL - public final class BEL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BEL - public static var sharedInstance = BEL(code: "BEL") - } - - /// Currency BGL - public final class BGL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BGL - public static var sharedInstance = BGL(code: "BGL") - } - - /// Currency BGM - public final class BGM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BGM - public static var sharedInstance = BGM(code: "BGM") - } - - /// Currency BGN - public final class BGN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BGN - public static var sharedInstance = BGN(code: "BGN") - } - - /// Currency BGO - public final class BGO: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BGO - public static var sharedInstance = BGO(code: "BGO") - } - - /// Currency BHD - public final class BHD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BHD - public static var sharedInstance = BHD(code: "BHD") - } - - /// Currency BIF - public final class BIF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BIF - public static var sharedInstance = BIF(code: "BIF") - } - - /// Currency BMD - public final class BMD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BMD - public static var sharedInstance = BMD(code: "BMD") - } - - /// Currency BND - public final class BND: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BND - public static var sharedInstance = BND(code: "BND") - } - - /// Currency BOB - public final class BOB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BOB - public static var sharedInstance = BOB(code: "BOB") - } - - /// Currency BOL - public final class BOL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BOL - public static var sharedInstance = BOL(code: "BOL") - } - - /// Currency BOP - public final class BOP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BOP - public static var sharedInstance = BOP(code: "BOP") - } - - /// Currency BOV - public final class BOV: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BOV - public static var sharedInstance = BOV(code: "BOV") - } - - /// Currency BRB - public final class BRB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRB - public static var sharedInstance = BRB(code: "BRB") - } - - /// Currency BRC - public final class BRC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRC - public static var sharedInstance = BRC(code: "BRC") - } - - /// Currency BRE - public final class BRE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRE - public static var sharedInstance = BRE(code: "BRE") - } - - /// Currency BRL - public final class BRL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRL - public static var sharedInstance = BRL(code: "BRL") - } - - /// Currency BRN - public final class BRN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRN - public static var sharedInstance = BRN(code: "BRN") - } - - /// Currency BRR - public final class BRR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRR - public static var sharedInstance = BRR(code: "BRR") - } - - /// Currency BRZ - public final class BRZ: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BRZ - public static var sharedInstance = BRZ(code: "BRZ") - } - - /// Currency BSD - public final class BSD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BSD - public static var sharedInstance = BSD(code: "BSD") - } - - /// Currency BTN - public final class BTN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BTN - public static var sharedInstance = BTN(code: "BTN") - } - - /// Currency BUK - public final class BUK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BUK - public static var sharedInstance = BUK(code: "BUK") - } - - /// Currency BWP - public final class BWP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BWP - public static var sharedInstance = BWP(code: "BWP") - } - - /// Currency BYB - public final class BYB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BYB - public static var sharedInstance = BYB(code: "BYB") - } - - /// Currency BYR - public final class BYR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BYR - public static var sharedInstance = BYR(code: "BYR") - } - - /// Currency BZD - public final class BZD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.BZD - public static var sharedInstance = BZD(code: "BZD") - } - - /// Currency CAD - public final class CAD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CAD - public static var sharedInstance = CAD(code: "CAD") - } - - /// Currency CDF - public final class CDF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CDF - public static var sharedInstance = CDF(code: "CDF") - } - - /// Currency CHE - public final class CHE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CHE - public static var sharedInstance = CHE(code: "CHE") - } - - /// Currency CHF - public final class CHF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CHF - public static var sharedInstance = CHF(code: "CHF") - } - - /// Currency CHW - public final class CHW: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CHW - public static var sharedInstance = CHW(code: "CHW") - } - - /// Currency CLE - public final class CLE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CLE - public static var sharedInstance = CLE(code: "CLE") - } - - /// Currency CLF - public final class CLF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CLF - public static var sharedInstance = CLF(code: "CLF") - } - - /// Currency CLP - public final class CLP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CLP - public static var sharedInstance = CLP(code: "CLP") - } - - /// Currency CNX - public final class CNX: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CNX - public static var sharedInstance = CNX(code: "CNX") - } - - /// Currency CNY - public final class CNY: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CNY - public static var sharedInstance = CNY(code: "CNY") - } - - /// Currency COP - public final class COP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.COP - public static var sharedInstance = COP(code: "COP") - } - - /// Currency COU - public final class COU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.COU - public static var sharedInstance = COU(code: "COU") - } - - /// Currency CRC - public final class CRC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CRC - public static var sharedInstance = CRC(code: "CRC") - } - - /// Currency CSD - public final class CSD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CSD - public static var sharedInstance = CSD(code: "CSD") - } - - /// Currency CSK - public final class CSK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CSK - public static var sharedInstance = CSK(code: "CSK") - } - - /// Currency CUC - public final class CUC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CUC - public static var sharedInstance = CUC(code: "CUC") - } - - /// Currency CUP - public final class CUP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CUP - public static var sharedInstance = CUP(code: "CUP") - } - - /// Currency CVE - public final class CVE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CVE - public static var sharedInstance = CVE(code: "CVE") - } - - /// Currency CYP - public final class CYP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CYP - public static var sharedInstance = CYP(code: "CYP") - } - - /// Currency CZK - public final class CZK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.CZK - public static var sharedInstance = CZK(code: "CZK") - } - - /// Currency DDM - public final class DDM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DDM - public static var sharedInstance = DDM(code: "DDM") - } - - /// Currency DEM - public final class DEM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DEM - public static var sharedInstance = DEM(code: "DEM") - } - - /// Currency DJF - public final class DJF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DJF - public static var sharedInstance = DJF(code: "DJF") - } - - /// Currency DKK - public final class DKK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DKK - public static var sharedInstance = DKK(code: "DKK") - } - - /// Currency DOP - public final class DOP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DOP - public static var sharedInstance = DOP(code: "DOP") - } - - /// Currency DZD - public final class DZD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.DZD - public static var sharedInstance = DZD(code: "DZD") - } - - /// Currency ECS - public final class ECS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ECS - public static var sharedInstance = ECS(code: "ECS") - } - - /// Currency ECV - public final class ECV: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ECV - public static var sharedInstance = ECV(code: "ECV") - } - - /// Currency EEK - public final class EEK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.EEK - public static var sharedInstance = EEK(code: "EEK") - } - - /// Currency EGP - public final class EGP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.EGP - public static var sharedInstance = EGP(code: "EGP") - } - - /// Currency EQE - public final class EQE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.EQE - public static var sharedInstance = EQE(code: "EQE") - } - - /// Currency ERN - public final class ERN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ERN - public static var sharedInstance = ERN(code: "ERN") - } - - /// Currency ESA - public final class ESA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ESA - public static var sharedInstance = ESA(code: "ESA") - } - - /// Currency ESB - public final class ESB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ESB - public static var sharedInstance = ESB(code: "ESB") - } - - /// Currency ESP - public final class ESP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ESP - public static var sharedInstance = ESP(code: "ESP") - } - - /// Currency ETB - public final class ETB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ETB - public static var sharedInstance = ETB(code: "ETB") - } - - /// Currency EUR - public final class EUR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.EUR - public static var sharedInstance = EUR(code: "EUR") - } - - /// Currency FIM - public final class FIM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.FIM - public static var sharedInstance = FIM(code: "FIM") - } - - /// Currency FJD - public final class FJD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.FJD - public static var sharedInstance = FJD(code: "FJD") - } - - /// Currency FKP - public final class FKP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.FKP - public static var sharedInstance = FKP(code: "FKP") - } - - /// Currency FRF - public final class FRF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.FRF - public static var sharedInstance = FRF(code: "FRF") - } - - /// Currency GBP - public final class GBP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GBP - public static var sharedInstance = GBP(code: "GBP") - } - - /// Currency GEK - public final class GEK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GEK - public static var sharedInstance = GEK(code: "GEK") - } - - /// Currency GEL - public final class GEL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GEL - public static var sharedInstance = GEL(code: "GEL") - } - - /// Currency GHC - public final class GHC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GHC - public static var sharedInstance = GHC(code: "GHC") - } - - /// Currency GHS - public final class GHS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GHS - public static var sharedInstance = GHS(code: "GHS") - } - - /// Currency GIP - public final class GIP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GIP - public static var sharedInstance = GIP(code: "GIP") - } - - /// Currency GMD - public final class GMD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GMD - public static var sharedInstance = GMD(code: "GMD") - } - - /// Currency GNF - public final class GNF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GNF - public static var sharedInstance = GNF(code: "GNF") - } - - /// Currency GNS - public final class GNS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GNS - public static var sharedInstance = GNS(code: "GNS") - } - - /// Currency GQE - public final class GQE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GQE - public static var sharedInstance = GQE(code: "GQE") - } - - /// Currency GRD - public final class GRD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GRD - public static var sharedInstance = GRD(code: "GRD") - } - - /// Currency GTQ - public final class GTQ: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GTQ - public static var sharedInstance = GTQ(code: "GTQ") - } - - /// Currency GWE - public final class GWE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GWE - public static var sharedInstance = GWE(code: "GWE") - } - - /// Currency GWP - public final class GWP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GWP - public static var sharedInstance = GWP(code: "GWP") - } - - /// Currency GYD - public final class GYD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.GYD - public static var sharedInstance = GYD(code: "GYD") - } - - /// Currency HKD - public final class HKD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HKD - public static var sharedInstance = HKD(code: "HKD") - } - - /// Currency HNL - public final class HNL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HNL - public static var sharedInstance = HNL(code: "HNL") - } - - /// Currency HRD - public final class HRD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HRD - public static var sharedInstance = HRD(code: "HRD") - } - - /// Currency HRK - public final class HRK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HRK - public static var sharedInstance = HRK(code: "HRK") - } - - /// Currency HTG - public final class HTG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HTG - public static var sharedInstance = HTG(code: "HTG") - } - - /// Currency HUF - public final class HUF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.HUF - public static var sharedInstance = HUF(code: "HUF") - } - - /// Currency IDR - public final class IDR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.IDR - public static var sharedInstance = IDR(code: "IDR") - } - - /// Currency IEP - public final class IEP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.IEP - public static var sharedInstance = IEP(code: "IEP") - } - - /// Currency ILP - public final class ILP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ILP - public static var sharedInstance = ILP(code: "ILP") - } - - /// Currency ILR - public final class ILR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ILR - public static var sharedInstance = ILR(code: "ILR") - } - - /// Currency ILS - public final class ILS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ILS - public static var sharedInstance = ILS(code: "ILS") - } - - /// Currency INR - public final class INR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.INR - public static var sharedInstance = INR(code: "INR") - } - - /// Currency IQD - public final class IQD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.IQD - public static var sharedInstance = IQD(code: "IQD") - } - - /// Currency IRR - public final class IRR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.IRR - public static var sharedInstance = IRR(code: "IRR") - } - - /// Currency ISJ - public final class ISJ: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ISJ - public static var sharedInstance = ISJ(code: "ISJ") - } - - /// Currency ISK - public final class ISK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ISK - public static var sharedInstance = ISK(code: "ISK") - } - - /// Currency ITL - public final class ITL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ITL - public static var sharedInstance = ITL(code: "ITL") - } - - /// Currency JMD - public final class JMD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.JMD - public static var sharedInstance = JMD(code: "JMD") - } - - /// Currency JOD - public final class JOD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.JOD - public static var sharedInstance = JOD(code: "JOD") - } - - /// Currency JPY - public final class JPY: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.JPY - public static var sharedInstance = JPY(code: "JPY") - } - - /// Currency KES - public final class KES: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KES - public static var sharedInstance = KES(code: "KES") - } - - /// Currency KGS - public final class KGS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KGS - public static var sharedInstance = KGS(code: "KGS") - } - - /// Currency KHR - public final class KHR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KHR - public static var sharedInstance = KHR(code: "KHR") - } - - /// Currency KMF - public final class KMF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KMF - public static var sharedInstance = KMF(code: "KMF") - } - - /// Currency KPW - public final class KPW: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KPW - public static var sharedInstance = KPW(code: "KPW") - } - - /// Currency KRH - public final class KRH: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KRH - public static var sharedInstance = KRH(code: "KRH") - } - - /// Currency KRO - public final class KRO: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KRO - public static var sharedInstance = KRO(code: "KRO") - } - - /// Currency KRW - public final class KRW: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KRW - public static var sharedInstance = KRW(code: "KRW") - } - - /// Currency KWD - public final class KWD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KWD - public static var sharedInstance = KWD(code: "KWD") - } - - /// Currency KYD - public final class KYD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KYD - public static var sharedInstance = KYD(code: "KYD") - } - - /// Currency KZT - public final class KZT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.KZT - public static var sharedInstance = KZT(code: "KZT") - } - - /// Currency LAK - public final class LAK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LAK - public static var sharedInstance = LAK(code: "LAK") - } - - /// Currency LBP - public final class LBP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LBP - public static var sharedInstance = LBP(code: "LBP") - } - - /// Currency LKR - public final class LKR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LKR - public static var sharedInstance = LKR(code: "LKR") - } - - /// Currency LRD - public final class LRD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LRD - public static var sharedInstance = LRD(code: "LRD") - } - - /// Currency LSL - public final class LSL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LSL - public static var sharedInstance = LSL(code: "LSL") - } - - /// Currency LSM - public final class LSM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LSM - public static var sharedInstance = LSM(code: "LSM") - } - - /// Currency LTL - public final class LTL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LTL - public static var sharedInstance = LTL(code: "LTL") - } - - /// Currency LTT - public final class LTT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LTT - public static var sharedInstance = LTT(code: "LTT") - } - - /// Currency LUC - public final class LUC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LUC - public static var sharedInstance = LUC(code: "LUC") - } - - /// Currency LUF - public final class LUF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LUF - public static var sharedInstance = LUF(code: "LUF") - } - - /// Currency LUL - public final class LUL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LUL - public static var sharedInstance = LUL(code: "LUL") - } - - /// Currency LVL - public final class LVL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LVL - public static var sharedInstance = LVL(code: "LVL") - } - - /// Currency LVR - public final class LVR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LVR - public static var sharedInstance = LVR(code: "LVR") - } - - /// Currency LYD - public final class LYD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.LYD - public static var sharedInstance = LYD(code: "LYD") - } - - /// Currency MAD - public final class MAD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MAD - public static var sharedInstance = MAD(code: "MAD") - } - - /// Currency MAF - public final class MAF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MAF - public static var sharedInstance = MAF(code: "MAF") - } - - /// Currency MCF - public final class MCF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MCF - public static var sharedInstance = MCF(code: "MCF") - } - - /// Currency MDC - public final class MDC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MDC - public static var sharedInstance = MDC(code: "MDC") - } - - /// Currency MDL - public final class MDL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MDL - public static var sharedInstance = MDL(code: "MDL") - } - - /// Currency MGA - public final class MGA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MGA - public static var sharedInstance = MGA(code: "MGA") - } - - /// Currency MGF - public final class MGF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MGF - public static var sharedInstance = MGF(code: "MGF") - } - - /// Currency MKD - public final class MKD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MKD - public static var sharedInstance = MKD(code: "MKD") - } - - /// Currency MKN - public final class MKN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MKN - public static var sharedInstance = MKN(code: "MKN") - } - - /// Currency MLF - public final class MLF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MLF - public static var sharedInstance = MLF(code: "MLF") - } - - /// Currency MMK - public final class MMK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MMK - public static var sharedInstance = MMK(code: "MMK") - } - - /// Currency MNT - public final class MNT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MNT - public static var sharedInstance = MNT(code: "MNT") - } - - /// Currency MOP - public final class MOP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MOP - public static var sharedInstance = MOP(code: "MOP") - } - - /// Currency MRO - public final class MRO: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MRO - public static var sharedInstance = MRO(code: "MRO") - } - - /// Currency MTL - public final class MTL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MTL - public static var sharedInstance = MTL(code: "MTL") - } - - /// Currency MTP - public final class MTP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MTP - public static var sharedInstance = MTP(code: "MTP") - } - - /// Currency MUR - public final class MUR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MUR - public static var sharedInstance = MUR(code: "MUR") - } - - /// Currency MVP - public final class MVP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MVP - public static var sharedInstance = MVP(code: "MVP") - } - - /// Currency MVR - public final class MVR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MVR - public static var sharedInstance = MVR(code: "MVR") - } - - /// Currency MWK - public final class MWK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MWK - public static var sharedInstance = MWK(code: "MWK") - } - - /// Currency MXN - public final class MXN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MXN - public static var sharedInstance = MXN(code: "MXN") - } - - /// Currency MXP - public final class MXP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MXP - public static var sharedInstance = MXP(code: "MXP") - } - - /// Currency MXV - public final class MXV: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MXV - public static var sharedInstance = MXV(code: "MXV") - } - - /// Currency MYR - public final class MYR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MYR - public static var sharedInstance = MYR(code: "MYR") - } - - /// Currency MZE - public final class MZE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MZE - public static var sharedInstance = MZE(code: "MZE") - } - - /// Currency MZM - public final class MZM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MZM - public static var sharedInstance = MZM(code: "MZM") - } - - /// Currency MZN - public final class MZN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.MZN - public static var sharedInstance = MZN(code: "MZN") - } - - /// Currency NAD - public final class NAD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NAD - public static var sharedInstance = NAD(code: "NAD") - } - - /// Currency NGN - public final class NGN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NGN - public static var sharedInstance = NGN(code: "NGN") - } - - /// Currency NIC - public final class NIC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NIC - public static var sharedInstance = NIC(code: "NIC") - } - - /// Currency NIO - public final class NIO: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NIO - public static var sharedInstance = NIO(code: "NIO") - } - - /// Currency NLG - public final class NLG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NLG - public static var sharedInstance = NLG(code: "NLG") - } - - /// Currency NOK - public final class NOK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NOK - public static var sharedInstance = NOK(code: "NOK") - } - - /// Currency NPR - public final class NPR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NPR - public static var sharedInstance = NPR(code: "NPR") - } - - /// Currency NZD - public final class NZD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.NZD - public static var sharedInstance = NZD(code: "NZD") - } - - /// Currency OMR - public final class OMR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.OMR - public static var sharedInstance = OMR(code: "OMR") - } - - /// Currency PAB - public final class PAB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PAB - public static var sharedInstance = PAB(code: "PAB") - } - - /// Currency PEI - public final class PEI: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PEI - public static var sharedInstance = PEI(code: "PEI") - } - - /// Currency PEN - public final class PEN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PEN - public static var sharedInstance = PEN(code: "PEN") - } - - /// Currency PES - public final class PES: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PES - public static var sharedInstance = PES(code: "PES") - } - - /// Currency PGK - public final class PGK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PGK - public static var sharedInstance = PGK(code: "PGK") - } - - /// Currency PHP - public final class PHP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PHP - public static var sharedInstance = PHP(code: "PHP") - } - - /// Currency PKR - public final class PKR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PKR - public static var sharedInstance = PKR(code: "PKR") - } - - /// Currency PLN - public final class PLN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PLN - public static var sharedInstance = PLN(code: "PLN") - } - - /// Currency PLZ - public final class PLZ: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PLZ - public static var sharedInstance = PLZ(code: "PLZ") - } - - /// Currency PTE - public final class PTE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PTE - public static var sharedInstance = PTE(code: "PTE") - } - - /// Currency PYG - public final class PYG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.PYG - public static var sharedInstance = PYG(code: "PYG") - } - - /// Currency QAR - public final class QAR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.QAR - public static var sharedInstance = QAR(code: "QAR") - } - - /// Currency RHD - public final class RHD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RHD - public static var sharedInstance = RHD(code: "RHD") - } - - /// Currency ROL - public final class ROL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ROL - public static var sharedInstance = ROL(code: "ROL") - } - - /// Currency RON - public final class RON: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RON - public static var sharedInstance = RON(code: "RON") - } - - /// Currency RSD - public final class RSD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RSD - public static var sharedInstance = RSD(code: "RSD") - } - - /// Currency RUB - public final class RUB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RUB - public static var sharedInstance = RUB(code: "RUB") - } - - /// Currency RUR - public final class RUR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RUR - public static var sharedInstance = RUR(code: "RUR") - } - - /// Currency RWF - public final class RWF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.RWF - public static var sharedInstance = RWF(code: "RWF") - } - - /// Currency SAR - public final class SAR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SAR - public static var sharedInstance = SAR(code: "SAR") - } - - /// Currency SBD - public final class SBD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SBD - public static var sharedInstance = SBD(code: "SBD") - } - - /// Currency SCR - public final class SCR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SCR - public static var sharedInstance = SCR(code: "SCR") - } - - /// Currency SDD - public final class SDD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SDD - public static var sharedInstance = SDD(code: "SDD") - } - - /// Currency SDG - public final class SDG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SDG - public static var sharedInstance = SDG(code: "SDG") - } - - /// Currency SDP - public final class SDP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SDP - public static var sharedInstance = SDP(code: "SDP") - } - - /// Currency SEK - public final class SEK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SEK - public static var sharedInstance = SEK(code: "SEK") - } - - /// Currency SGD - public final class SGD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SGD - public static var sharedInstance = SGD(code: "SGD") - } - - /// Currency SHP - public final class SHP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SHP - public static var sharedInstance = SHP(code: "SHP") - } - - /// Currency SIT - public final class SIT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SIT - public static var sharedInstance = SIT(code: "SIT") - } - - /// Currency SKK - public final class SKK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SKK - public static var sharedInstance = SKK(code: "SKK") - } - - /// Currency SLL - public final class SLL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SLL - public static var sharedInstance = SLL(code: "SLL") - } - - /// Currency SOS - public final class SOS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SOS - public static var sharedInstance = SOS(code: "SOS") - } - - /// Currency SRD - public final class SRD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SRD - public static var sharedInstance = SRD(code: "SRD") - } - - /// Currency SRG - public final class SRG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SRG - public static var sharedInstance = SRG(code: "SRG") - } - - /// Currency SSP - public final class SSP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SSP - public static var sharedInstance = SSP(code: "SSP") - } - - /// Currency STD - public final class STD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.STD - public static var sharedInstance = STD(code: "STD") - } - - /// Currency SUR - public final class SUR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SUR - public static var sharedInstance = SUR(code: "SUR") - } - - /// Currency SVC - public final class SVC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SVC - public static var sharedInstance = SVC(code: "SVC") - } - - /// Currency SYP - public final class SYP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SYP - public static var sharedInstance = SYP(code: "SYP") - } - - /// Currency SZL - public final class SZL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.SZL - public static var sharedInstance = SZL(code: "SZL") - } - - /// Currency THB - public final class THB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.THB - public static var sharedInstance = THB(code: "THB") - } - - /// Currency TJR - public final class TJR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TJR - public static var sharedInstance = TJR(code: "TJR") - } - - /// Currency TJS - public final class TJS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TJS - public static var sharedInstance = TJS(code: "TJS") - } - - /// Currency TMM - public final class TMM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TMM - public static var sharedInstance = TMM(code: "TMM") - } - - /// Currency TMT - public final class TMT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TMT - public static var sharedInstance = TMT(code: "TMT") - } - - /// Currency TND - public final class TND: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TND - public static var sharedInstance = TND(code: "TND") - } - - /// Currency TOP - public final class TOP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TOP - public static var sharedInstance = TOP(code: "TOP") - } - - /// Currency TPE - public final class TPE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TPE - public static var sharedInstance = TPE(code: "TPE") - } - - /// Currency TRL - public final class TRL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TRL - public static var sharedInstance = TRL(code: "TRL") - } - - /// Currency TRY - public final class TRY: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TRY - public static var sharedInstance = TRY(code: "TRY") - } - - /// Currency TTD - public final class TTD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TTD - public static var sharedInstance = TTD(code: "TTD") - } - - /// Currency TWD - public final class TWD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TWD - public static var sharedInstance = TWD(code: "TWD") - } - - /// Currency TZS - public final class TZS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.TZS - public static var sharedInstance = TZS(code: "TZS") - } - - /// Currency UAH - public final class UAH: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UAH - public static var sharedInstance = UAH(code: "UAH") - } - - /// Currency UAK - public final class UAK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UAK - public static var sharedInstance = UAK(code: "UAK") - } - - /// Currency UGS - public final class UGS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UGS - public static var sharedInstance = UGS(code: "UGS") - } - - /// Currency UGX - public final class UGX: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UGX - public static var sharedInstance = UGX(code: "UGX") - } - - /// Currency USD - public final class USD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.USD - public static var sharedInstance = USD(code: "USD") - } - - /// Currency USN - public final class USN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.USN - public static var sharedInstance = USN(code: "USN") - } - - /// Currency USS - public final class USS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.USS - public static var sharedInstance = USS(code: "USS") - } - - /// Currency UYI - public final class UYI: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UYI - public static var sharedInstance = UYI(code: "UYI") - } - - /// Currency UYP - public final class UYP: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UYP - public static var sharedInstance = UYP(code: "UYP") - } - - /// Currency UYU - public final class UYU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UYU - public static var sharedInstance = UYU(code: "UYU") - } - - /// Currency UZS - public final class UZS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.UZS - public static var sharedInstance = UZS(code: "UZS") - } - - /// Currency VEB - public final class VEB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.VEB - public static var sharedInstance = VEB(code: "VEB") - } - - /// Currency VEF - public final class VEF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.VEF - public static var sharedInstance = VEF(code: "VEF") - } - - /// Currency VND - public final class VND: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.VND - public static var sharedInstance = VND(code: "VND") - } - - /// Currency VNN - public final class VNN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.VNN - public static var sharedInstance = VNN(code: "VNN") - } - - /// Currency VUV - public final class VUV: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.VUV - public static var sharedInstance = VUV(code: "VUV") - } - - /// Currency WST - public final class WST: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.WST - public static var sharedInstance = WST(code: "WST") - } - - /// Currency XAF - public final class XAF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XAF - public static var sharedInstance = XAF(code: "XAF") - } - - /// Currency XAG - public final class XAG: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XAG - public static var sharedInstance = XAG(code: "XAG") - } - - /// Currency XAU - public final class XAU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XAU - public static var sharedInstance = XAU(code: "XAU") - } - - /// Currency XBA - public final class XBA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XBA - public static var sharedInstance = XBA(code: "XBA") - } - - /// Currency XBB - public final class XBB: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XBB - public static var sharedInstance = XBB(code: "XBB") - } - - /// Currency XBC - public final class XBC: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XBC - public static var sharedInstance = XBC(code: "XBC") - } - - /// Currency XBD - public final class XBD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XBD - public static var sharedInstance = XBD(code: "XBD") - } - - /// Currency XCD - public final class XCD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XCD - public static var sharedInstance = XCD(code: "XCD") - } - - /// Currency XDR - public final class XDR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XDR - public static var sharedInstance = XDR(code: "XDR") - } - - /// Currency XEU - public final class XEU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XEU - public static var sharedInstance = XEU(code: "XEU") - } - - /// Currency XFO - public final class XFO: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XFO - public static var sharedInstance = XFO(code: "XFO") - } - - /// Currency XFU - public final class XFU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XFU - public static var sharedInstance = XFU(code: "XFU") - } - - /// Currency XOF - public final class XOF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XOF - public static var sharedInstance = XOF(code: "XOF") - } - - /// Currency XPD - public final class XPD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XPD - public static var sharedInstance = XPD(code: "XPD") - } - - /// Currency XPF - public final class XPF: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XPF - public static var sharedInstance = XPF(code: "XPF") - } - - /// Currency XPT - public final class XPT: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XPT - public static var sharedInstance = XPT(code: "XPT") - } - - /// Currency XRE - public final class XRE: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XRE - public static var sharedInstance = XRE(code: "XRE") - } - - /// Currency XSU - public final class XSU: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XSU - public static var sharedInstance = XSU(code: "XSU") - } - - /// Currency XTS - public final class XTS: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XTS - public static var sharedInstance = XTS(code: "XTS") - } - - /// Currency XUA - public final class XUA: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XUA - public static var sharedInstance = XUA(code: "XUA") - } - - /// Currency XXX - public final class XXX: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.XXX - public static var sharedInstance = XXX(code: "XXX") - } - - /// Currency YDD - public final class YDD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YDD - public static var sharedInstance = YDD(code: "YDD") - } - - /// Currency YER - public final class YER: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YER - public static var sharedInstance = YER(code: "YER") - } - - /// Currency YUD - public final class YUD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YUD - public static var sharedInstance = YUD(code: "YUD") - } - - /// Currency YUM - public final class YUM: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YUM - public static var sharedInstance = YUM(code: "YUM") - } - - /// Currency YUN - public final class YUN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YUN - public static var sharedInstance = YUN(code: "YUN") - } - - /// Currency YUR - public final class YUR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.YUR - public static var sharedInstance = YUR(code: "YUR") - } - - /// Currency ZAL - public final class ZAL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZAL - public static var sharedInstance = ZAL(code: "ZAL") - } - - /// Currency ZAR - public final class ZAR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZAR - public static var sharedInstance = ZAR(code: "ZAR") - } - - /// Currency ZMK - public final class ZMK: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZMK - public static var sharedInstance = ZMK(code: "ZMK") - } - - /// Currency ZMW - public final class ZMW: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZMW - public static var sharedInstance = ZMW(code: "ZMW") - } - - /// Currency ZRN - public final class ZRN: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZRN - public static var sharedInstance = ZRN(code: "ZRN") - } - - /// Currency ZRZ - public final class ZRZ: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZRZ - public static var sharedInstance = ZRZ(code: "ZRZ") - } - - /// Currency ZWL - public final class ZWL: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZWL - public static var sharedInstance = ZWL(code: "ZWL") - } - - /// Currency ZWR - public final class ZWR: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZWR - public static var sharedInstance = ZWR(code: "ZWR") - } - - /// Currency ZWD - public final class ZWD: Currency.Base, ISOCurrencyType { - /// - returns: lazy shared instance for Currency.ZWD - public static var sharedInstance = ZWD(code: "ZWD") - } + /// Currency ADP + public final class ADP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ADP + public static let shared = ADP(code: "ADP") + } + + /// Currency AED + public final class AED: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AED + public static let shared = AED(code: "AED") + } + + /// Currency AFA + public final class AFA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AFA + public static let shared = AFA(code: "AFA") + } + + /// Currency AFN + public final class AFN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AFN + public static let shared = AFN(code: "AFN") + } + + /// Currency ALK + public final class ALK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ALK + public static let shared = ALK(code: "ALK") + } + + /// Currency ALL + public final class ALL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ALL + public static let shared = ALL(code: "ALL") + } + + /// Currency AMD + public final class AMD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AMD + public static let shared = AMD(code: "AMD") + } + + /// Currency ANG + public final class ANG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ANG + public static let shared = ANG(code: "ANG") + } + + /// Currency AOA + public final class AOA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AOA + public static let shared = AOA(code: "AOA") + } + + /// Currency AOK + public final class AOK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AOK + public static let shared = AOK(code: "AOK") + } + + /// Currency AON + public final class AON: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AON + public static let shared = AON(code: "AON") + } + + /// Currency AOR + public final class AOR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AOR + public static let shared = AOR(code: "AOR") + } + + /// Currency ARA + public final class ARA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ARA + public static let shared = ARA(code: "ARA") + } + + /// Currency ARL + public final class ARL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ARL + public static let shared = ARL(code: "ARL") + } + + /// Currency ARM + public final class ARM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ARM + public static let shared = ARM(code: "ARM") + } + + /// Currency ARP + public final class ARP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ARP + public static let shared = ARP(code: "ARP") + } + + /// Currency ARS + public final class ARS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ARS + public static let shared = ARS(code: "ARS") + } + + /// Currency ATS + public final class ATS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ATS + public static let shared = ATS(code: "ATS") + } + + /// Currency AUD + public final class AUD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AUD + public static let shared = AUD(code: "AUD") + } + + /// Currency AWG + public final class AWG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AWG + public static let shared = AWG(code: "AWG") + } + + /// Currency AZM + public final class AZM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AZM + public static let shared = AZM(code: "AZM") + } + + /// Currency AZN + public final class AZN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.AZN + public static let shared = AZN(code: "AZN") + } + + /// Currency BAD + public final class BAD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BAD + public static let shared = BAD(code: "BAD") + } + + /// Currency BAM + public final class BAM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BAM + public static let shared = BAM(code: "BAM") + } + + /// Currency BAN + public final class BAN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BAN + public static let shared = BAN(code: "BAN") + } + + /// Currency BBD + public final class BBD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BBD + public static let shared = BBD(code: "BBD") + } + + /// Currency BDT + public final class BDT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BDT + public static let shared = BDT(code: "BDT") + } + + /// Currency BEC + public final class BEC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BEC + public static let shared = BEC(code: "BEC") + } + + /// Currency BEF + public final class BEF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BEF + public static let shared = BEF(code: "BEF") + } + + /// Currency BEL + public final class BEL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BEL + public static let shared = BEL(code: "BEL") + } + + /// Currency BGL + public final class BGL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BGL + public static let shared = BGL(code: "BGL") + } + + /// Currency BGM + public final class BGM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BGM + public static let shared = BGM(code: "BGM") + } + + /// Currency BGN + public final class BGN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BGN + public static let shared = BGN(code: "BGN") + } + + /// Currency BGO + public final class BGO: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BGO + public static let shared = BGO(code: "BGO") + } + + /// Currency BHD + public final class BHD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BHD + public static let shared = BHD(code: "BHD") + } + + /// Currency BIF + public final class BIF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BIF + public static let shared = BIF(code: "BIF") + } + + /// Currency BMD + public final class BMD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BMD + public static let shared = BMD(code: "BMD") + } + + /// Currency BND + public final class BND: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BND + public static let shared = BND(code: "BND") + } + + /// Currency BOB + public final class BOB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BOB + public static let shared = BOB(code: "BOB") + } + + /// Currency BOL + public final class BOL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BOL + public static let shared = BOL(code: "BOL") + } + + /// Currency BOP + public final class BOP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BOP + public static let shared = BOP(code: "BOP") + } + + /// Currency BOV + public final class BOV: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BOV + public static let shared = BOV(code: "BOV") + } + + /// Currency BRB + public final class BRB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRB + public static let shared = BRB(code: "BRB") + } + + /// Currency BRC + public final class BRC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRC + public static let shared = BRC(code: "BRC") + } + + /// Currency BRE + public final class BRE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRE + public static let shared = BRE(code: "BRE") + } + + /// Currency BRL + public final class BRL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRL + public static let shared = BRL(code: "BRL") + } + + /// Currency BRN + public final class BRN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRN + public static let shared = BRN(code: "BRN") + } + + /// Currency BRR + public final class BRR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRR + public static let shared = BRR(code: "BRR") + } + + /// Currency BRZ + public final class BRZ: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BRZ + public static let shared = BRZ(code: "BRZ") + } + + /// Currency BSD + public final class BSD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BSD + public static let shared = BSD(code: "BSD") + } + + /// Currency BTN + public final class BTN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BTN + public static let shared = BTN(code: "BTN") + } + + /// Currency BUK + public final class BUK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BUK + public static let shared = BUK(code: "BUK") + } + + /// Currency BWP + public final class BWP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BWP + public static let shared = BWP(code: "BWP") + } + + /// Currency BYB + public final class BYB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BYB + public static let shared = BYB(code: "BYB") + } + + /// Currency BYR + public final class BYR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BYR + public static let shared = BYR(code: "BYR") + } + + /// Currency BZD + public final class BZD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.BZD + public static let shared = BZD(code: "BZD") + } + + /// Currency CAD + public final class CAD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CAD + public static let shared = CAD(code: "CAD") + } + + /// Currency CDF + public final class CDF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CDF + public static let shared = CDF(code: "CDF") + } + + /// Currency CHE + public final class CHE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CHE + public static let shared = CHE(code: "CHE") + } + + /// Currency CHF + public final class CHF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CHF + public static let shared = CHF(code: "CHF") + } + + /// Currency CHW + public final class CHW: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CHW + public static let shared = CHW(code: "CHW") + } + + /// Currency CLE + public final class CLE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CLE + public static let shared = CLE(code: "CLE") + } + + /// Currency CLF + public final class CLF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CLF + public static let shared = CLF(code: "CLF") + } + + /// Currency CLP + public final class CLP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CLP + public static let shared = CLP(code: "CLP") + } + + /// Currency CNX + public final class CNX: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CNX + public static let shared = CNX(code: "CNX") + } + + /// Currency CNY + public final class CNY: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CNY + public static let shared = CNY(code: "CNY") + } + + /// Currency COP + public final class COP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.COP + public static let shared = COP(code: "COP") + } + + /// Currency COU + public final class COU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.COU + public static let shared = COU(code: "COU") + } + + /// Currency CRC + public final class CRC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CRC + public static let shared = CRC(code: "CRC") + } + + /// Currency CSD + public final class CSD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CSD + public static let shared = CSD(code: "CSD") + } + + /// Currency CSK + public final class CSK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CSK + public static let shared = CSK(code: "CSK") + } + + /// Currency CUC + public final class CUC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CUC + public static let shared = CUC(code: "CUC") + } + + /// Currency CUP + public final class CUP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CUP + public static let shared = CUP(code: "CUP") + } + + /// Currency CVE + public final class CVE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CVE + public static let shared = CVE(code: "CVE") + } + + /// Currency CYP + public final class CYP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CYP + public static let shared = CYP(code: "CYP") + } + + /// Currency CZK + public final class CZK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.CZK + public static let shared = CZK(code: "CZK") + } + + /// Currency DDM + public final class DDM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DDM + public static let shared = DDM(code: "DDM") + } + + /// Currency DEM + public final class DEM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DEM + public static let shared = DEM(code: "DEM") + } + + /// Currency DJF + public final class DJF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DJF + public static let shared = DJF(code: "DJF") + } + + /// Currency DKK + public final class DKK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DKK + public static let shared = DKK(code: "DKK") + } + + /// Currency DOP + public final class DOP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DOP + public static let shared = DOP(code: "DOP") + } + + /// Currency DZD + public final class DZD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.DZD + public static let shared = DZD(code: "DZD") + } + + /// Currency ECS + public final class ECS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ECS + public static let shared = ECS(code: "ECS") + } + + /// Currency ECV + public final class ECV: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ECV + public static let shared = ECV(code: "ECV") + } + + /// Currency EEK + public final class EEK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.EEK + public static let shared = EEK(code: "EEK") + } + + /// Currency EGP + public final class EGP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.EGP + public static let shared = EGP(code: "EGP") + } + + /// Currency EQE + public final class EQE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.EQE + public static let shared = EQE(code: "EQE") + } + + /// Currency ERN + public final class ERN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ERN + public static let shared = ERN(code: "ERN") + } + + /// Currency ESA + public final class ESA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ESA + public static let shared = ESA(code: "ESA") + } + + /// Currency ESB + public final class ESB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ESB + public static let shared = ESB(code: "ESB") + } + + /// Currency ESP + public final class ESP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ESP + public static let shared = ESP(code: "ESP") + } + + /// Currency ETB + public final class ETB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ETB + public static let shared = ETB(code: "ETB") + } + + /// Currency EUR + public final class EUR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.EUR + public static let shared = EUR(code: "EUR") + } + + /// Currency FIM + public final class FIM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.FIM + public static let shared = FIM(code: "FIM") + } + + /// Currency FJD + public final class FJD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.FJD + public static let shared = FJD(code: "FJD") + } + + /// Currency FKP + public final class FKP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.FKP + public static let shared = FKP(code: "FKP") + } + + /// Currency FRF + public final class FRF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.FRF + public static let shared = FRF(code: "FRF") + } + + /// Currency GBP + public final class GBP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GBP + public static let shared = GBP(code: "GBP") + } + + /// Currency GEK + public final class GEK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GEK + public static let shared = GEK(code: "GEK") + } + + /// Currency GEL + public final class GEL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GEL + public static let shared = GEL(code: "GEL") + } + + /// Currency GHC + public final class GHC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GHC + public static let shared = GHC(code: "GHC") + } + + /// Currency GHS + public final class GHS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GHS + public static let shared = GHS(code: "GHS") + } + + /// Currency GIP + public final class GIP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GIP + public static let shared = GIP(code: "GIP") + } + + /// Currency GMD + public final class GMD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GMD + public static let shared = GMD(code: "GMD") + } + + /// Currency GNF + public final class GNF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GNF + public static let shared = GNF(code: "GNF") + } + + /// Currency GNS + public final class GNS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GNS + public static let shared = GNS(code: "GNS") + } + + /// Currency GQE + public final class GQE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GQE + public static let shared = GQE(code: "GQE") + } + + /// Currency GRD + public final class GRD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GRD + public static let shared = GRD(code: "GRD") + } + + /// Currency GTQ + public final class GTQ: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GTQ + public static let shared = GTQ(code: "GTQ") + } + + /// Currency GWE + public final class GWE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GWE + public static let shared = GWE(code: "GWE") + } + + /// Currency GWP + public final class GWP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GWP + public static let shared = GWP(code: "GWP") + } + + /// Currency GYD + public final class GYD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.GYD + public static let shared = GYD(code: "GYD") + } + + /// Currency HKD + public final class HKD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HKD + public static let shared = HKD(code: "HKD") + } + + /// Currency HNL + public final class HNL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HNL + public static let shared = HNL(code: "HNL") + } + + /// Currency HRD + public final class HRD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HRD + public static let shared = HRD(code: "HRD") + } + + /// Currency HRK + public final class HRK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HRK + public static let shared = HRK(code: "HRK") + } + + /// Currency HTG + public final class HTG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HTG + public static let shared = HTG(code: "HTG") + } + + /// Currency HUF + public final class HUF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.HUF + public static let shared = HUF(code: "HUF") + } + + /// Currency IDR + public final class IDR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.IDR + public static let shared = IDR(code: "IDR") + } + + /// Currency IEP + public final class IEP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.IEP + public static let shared = IEP(code: "IEP") + } + + /// Currency ILP + public final class ILP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ILP + public static let shared = ILP(code: "ILP") + } + + /// Currency ILR + public final class ILR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ILR + public static let shared = ILR(code: "ILR") + } + + /// Currency ILS + public final class ILS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ILS + public static let shared = ILS(code: "ILS") + } + + /// Currency INR + public final class INR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.INR + public static let shared = INR(code: "INR") + } + + /// Currency IQD + public final class IQD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.IQD + public static let shared = IQD(code: "IQD") + } + + /// Currency IRR + public final class IRR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.IRR + public static let shared = IRR(code: "IRR") + } + + /// Currency ISJ + public final class ISJ: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ISJ + public static let shared = ISJ(code: "ISJ") + } + + /// Currency ISK + public final class ISK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ISK + public static let shared = ISK(code: "ISK") + } + + /// Currency ITL + public final class ITL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ITL + public static let shared = ITL(code: "ITL") + } + + /// Currency JMD + public final class JMD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.JMD + public static let shared = JMD(code: "JMD") + } + + /// Currency JOD + public final class JOD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.JOD + public static let shared = JOD(code: "JOD") + } + + /// Currency JPY + public final class JPY: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.JPY + public static let shared = JPY(code: "JPY") + } + + /// Currency KES + public final class KES: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KES + public static let shared = KES(code: "KES") + } + + /// Currency KGS + public final class KGS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KGS + public static let shared = KGS(code: "KGS") + } + + /// Currency KHR + public final class KHR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KHR + public static let shared = KHR(code: "KHR") + } + + /// Currency KMF + public final class KMF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KMF + public static let shared = KMF(code: "KMF") + } + + /// Currency KPW + public final class KPW: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KPW + public static let shared = KPW(code: "KPW") + } + + /// Currency KRH + public final class KRH: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KRH + public static let shared = KRH(code: "KRH") + } + + /// Currency KRO + public final class KRO: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KRO + public static let shared = KRO(code: "KRO") + } + + /// Currency KRW + public final class KRW: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KRW + public static let shared = KRW(code: "KRW") + } + + /// Currency KWD + public final class KWD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KWD + public static let shared = KWD(code: "KWD") + } + + /// Currency KYD + public final class KYD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KYD + public static let shared = KYD(code: "KYD") + } + + /// Currency KZT + public final class KZT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.KZT + public static let shared = KZT(code: "KZT") + } + + /// Currency LAK + public final class LAK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LAK + public static let shared = LAK(code: "LAK") + } + + /// Currency LBP + public final class LBP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LBP + public static let shared = LBP(code: "LBP") + } + + /// Currency LKR + public final class LKR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LKR + public static let shared = LKR(code: "LKR") + } + + /// Currency LRD + public final class LRD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LRD + public static let shared = LRD(code: "LRD") + } + + /// Currency LSL + public final class LSL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LSL + public static let shared = LSL(code: "LSL") + } + + /// Currency LSM + public final class LSM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LSM + public static let shared = LSM(code: "LSM") + } + + /// Currency LTL + public final class LTL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LTL + public static let shared = LTL(code: "LTL") + } + + /// Currency LTT + public final class LTT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LTT + public static let shared = LTT(code: "LTT") + } + + /// Currency LUC + public final class LUC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LUC + public static let shared = LUC(code: "LUC") + } + + /// Currency LUF + public final class LUF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LUF + public static let shared = LUF(code: "LUF") + } + + /// Currency LUL + public final class LUL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LUL + public static let shared = LUL(code: "LUL") + } + + /// Currency LVL + public final class LVL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LVL + public static let shared = LVL(code: "LVL") + } + + /// Currency LVR + public final class LVR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LVR + public static let shared = LVR(code: "LVR") + } + + /// Currency LYD + public final class LYD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.LYD + public static let shared = LYD(code: "LYD") + } + + /// Currency MAD + public final class MAD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MAD + public static let shared = MAD(code: "MAD") + } + + /// Currency MAF + public final class MAF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MAF + public static let shared = MAF(code: "MAF") + } + + /// Currency MCF + public final class MCF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MCF + public static let shared = MCF(code: "MCF") + } + + /// Currency MDC + public final class MDC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MDC + public static let shared = MDC(code: "MDC") + } + + /// Currency MDL + public final class MDL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MDL + public static let shared = MDL(code: "MDL") + } + + /// Currency MGA + public final class MGA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MGA + public static let shared = MGA(code: "MGA") + } + + /// Currency MGF + public final class MGF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MGF + public static let shared = MGF(code: "MGF") + } + + /// Currency MKD + public final class MKD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MKD + public static let shared = MKD(code: "MKD") + } + + /// Currency MKN + public final class MKN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MKN + public static let shared = MKN(code: "MKN") + } + + /// Currency MLF + public final class MLF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MLF + public static let shared = MLF(code: "MLF") + } + + /// Currency MMK + public final class MMK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MMK + public static let shared = MMK(code: "MMK") + } + + /// Currency MNT + public final class MNT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MNT + public static let shared = MNT(code: "MNT") + } + + /// Currency MOP + public final class MOP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MOP + public static let shared = MOP(code: "MOP") + } + + /// Currency MRO + public final class MRO: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MRO + public static let shared = MRO(code: "MRO") + } + + /// Currency MTL + public final class MTL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MTL + public static let shared = MTL(code: "MTL") + } + + /// Currency MTP + public final class MTP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MTP + public static let shared = MTP(code: "MTP") + } + + /// Currency MUR + public final class MUR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MUR + public static let shared = MUR(code: "MUR") + } + + /// Currency MVP + public final class MVP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MVP + public static let shared = MVP(code: "MVP") + } + + /// Currency MVR + public final class MVR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MVR + public static let shared = MVR(code: "MVR") + } + + /// Currency MWK + public final class MWK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MWK + public static let shared = MWK(code: "MWK") + } + + /// Currency MXN + public final class MXN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MXN + public static let shared = MXN(code: "MXN") + } + + /// Currency MXP + public final class MXP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MXP + public static let shared = MXP(code: "MXP") + } + + /// Currency MXV + public final class MXV: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MXV + public static let shared = MXV(code: "MXV") + } + + /// Currency MYR + public final class MYR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MYR + public static let shared = MYR(code: "MYR") + } + + /// Currency MZE + public final class MZE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MZE + public static let shared = MZE(code: "MZE") + } + + /// Currency MZM + public final class MZM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MZM + public static let shared = MZM(code: "MZM") + } + + /// Currency MZN + public final class MZN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.MZN + public static let shared = MZN(code: "MZN") + } + + /// Currency NAD + public final class NAD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NAD + public static let shared = NAD(code: "NAD") + } + + /// Currency NGN + public final class NGN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NGN + public static let shared = NGN(code: "NGN") + } + + /// Currency NIC + public final class NIC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NIC + public static let shared = NIC(code: "NIC") + } + + /// Currency NIO + public final class NIO: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NIO + public static let shared = NIO(code: "NIO") + } + + /// Currency NLG + public final class NLG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NLG + public static let shared = NLG(code: "NLG") + } + + /// Currency NOK + public final class NOK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NOK + public static let shared = NOK(code: "NOK") + } + + /// Currency NPR + public final class NPR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NPR + public static let shared = NPR(code: "NPR") + } + + /// Currency NZD + public final class NZD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.NZD + public static let shared = NZD(code: "NZD") + } + + /// Currency OMR + public final class OMR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.OMR + public static let shared = OMR(code: "OMR") + } + + /// Currency PAB + public final class PAB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PAB + public static let shared = PAB(code: "PAB") + } + + /// Currency PEI + public final class PEI: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PEI + public static let shared = PEI(code: "PEI") + } + + /// Currency PEN + public final class PEN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PEN + public static let shared = PEN(code: "PEN") + } + + /// Currency PES + public final class PES: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PES + public static let shared = PES(code: "PES") + } + + /// Currency PGK + public final class PGK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PGK + public static let shared = PGK(code: "PGK") + } + + /// Currency PHP + public final class PHP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PHP + public static let shared = PHP(code: "PHP") + } + + /// Currency PKR + public final class PKR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PKR + public static let shared = PKR(code: "PKR") + } + + /// Currency PLN + public final class PLN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PLN + public static let shared = PLN(code: "PLN") + } + + /// Currency PLZ + public final class PLZ: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PLZ + public static let shared = PLZ(code: "PLZ") + } + + /// Currency PTE + public final class PTE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PTE + public static let shared = PTE(code: "PTE") + } + + /// Currency PYG + public final class PYG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.PYG + public static let shared = PYG(code: "PYG") + } + + /// Currency QAR + public final class QAR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.QAR + public static let shared = QAR(code: "QAR") + } + + /// Currency RHD + public final class RHD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RHD + public static let shared = RHD(code: "RHD") + } + + /// Currency ROL + public final class ROL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ROL + public static let shared = ROL(code: "ROL") + } + + /// Currency RON + public final class RON: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RON + public static let shared = RON(code: "RON") + } + + /// Currency RSD + public final class RSD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RSD + public static let shared = RSD(code: "RSD") + } + + /// Currency RUB + public final class RUB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RUB + public static let shared = RUB(code: "RUB") + } + + /// Currency RUR + public final class RUR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RUR + public static let shared = RUR(code: "RUR") + } + + /// Currency RWF + public final class RWF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.RWF + public static let shared = RWF(code: "RWF") + } + + /// Currency SAR + public final class SAR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SAR + public static let shared = SAR(code: "SAR") + } + + /// Currency SBD + public final class SBD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SBD + public static let shared = SBD(code: "SBD") + } + + /// Currency SCR + public final class SCR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SCR + public static let shared = SCR(code: "SCR") + } + + /// Currency SDD + public final class SDD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SDD + public static let shared = SDD(code: "SDD") + } + + /// Currency SDG + public final class SDG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SDG + public static let shared = SDG(code: "SDG") + } + + /// Currency SDP + public final class SDP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SDP + public static let shared = SDP(code: "SDP") + } + + /// Currency SEK + public final class SEK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SEK + public static let shared = SEK(code: "SEK") + } + + /// Currency SGD + public final class SGD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SGD + public static let shared = SGD(code: "SGD") + } + + /// Currency SHP + public final class SHP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SHP + public static let shared = SHP(code: "SHP") + } + + /// Currency SIT + public final class SIT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SIT + public static let shared = SIT(code: "SIT") + } + + /// Currency SKK + public final class SKK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SKK + public static let shared = SKK(code: "SKK") + } + + /// Currency SLL + public final class SLL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SLL + public static let shared = SLL(code: "SLL") + } + + /// Currency SOS + public final class SOS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SOS + public static let shared = SOS(code: "SOS") + } + + /// Currency SRD + public final class SRD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SRD + public static let shared = SRD(code: "SRD") + } + + /// Currency SRG + public final class SRG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SRG + public static let shared = SRG(code: "SRG") + } + + /// Currency SSP + public final class SSP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SSP + public static let shared = SSP(code: "SSP") + } + + /// Currency STD + public final class STD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.STD + public static let shared = STD(code: "STD") + } + + /// Currency SUR + public final class SUR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SUR + public static let shared = SUR(code: "SUR") + } + + /// Currency SVC + public final class SVC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SVC + public static let shared = SVC(code: "SVC") + } + + /// Currency SYP + public final class SYP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SYP + public static let shared = SYP(code: "SYP") + } + + /// Currency SZL + public final class SZL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.SZL + public static let shared = SZL(code: "SZL") + } + + /// Currency THB + public final class THB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.THB + public static let shared = THB(code: "THB") + } + + /// Currency TJR + public final class TJR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TJR + public static let shared = TJR(code: "TJR") + } + + /// Currency TJS + public final class TJS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TJS + public static let shared = TJS(code: "TJS") + } + + /// Currency TMM + public final class TMM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TMM + public static let shared = TMM(code: "TMM") + } + + /// Currency TMT + public final class TMT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TMT + public static let shared = TMT(code: "TMT") + } + + /// Currency TND + public final class TND: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TND + public static let shared = TND(code: "TND") + } + + /// Currency TOP + public final class TOP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TOP + public static let shared = TOP(code: "TOP") + } + + /// Currency TPE + public final class TPE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TPE + public static let shared = TPE(code: "TPE") + } + + /// Currency TRL + public final class TRL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TRL + public static let shared = TRL(code: "TRL") + } + + /// Currency TRY + public final class TRY: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TRY + public static let shared = TRY(code: "TRY") + } + + /// Currency TTD + public final class TTD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TTD + public static let shared = TTD(code: "TTD") + } + + /// Currency TWD + public final class TWD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TWD + public static let shared = TWD(code: "TWD") + } + + /// Currency TZS + public final class TZS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.TZS + public static let shared = TZS(code: "TZS") + } + + /// Currency UAH + public final class UAH: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UAH + public static let shared = UAH(code: "UAH") + } + + /// Currency UAK + public final class UAK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UAK + public static let shared = UAK(code: "UAK") + } + + /// Currency UGS + public final class UGS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UGS + public static let shared = UGS(code: "UGS") + } + + /// Currency UGX + public final class UGX: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UGX + public static let shared = UGX(code: "UGX") + } + + /// Currency USD + public final class USD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.USD + public static let shared = USD(code: "USD") + } + + /// Currency USN + public final class USN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.USN + public static let shared = USN(code: "USN") + } + + /// Currency USS + public final class USS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.USS + public static let shared = USS(code: "USS") + } + + /// Currency UYI + public final class UYI: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UYI + public static let shared = UYI(code: "UYI") + } + + /// Currency UYP + public final class UYP: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UYP + public static let shared = UYP(code: "UYP") + } + + /// Currency UYU + public final class UYU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UYU + public static let shared = UYU(code: "UYU") + } + + /// Currency UZS + public final class UZS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.UZS + public static let shared = UZS(code: "UZS") + } + + /// Currency VEB + public final class VEB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.VEB + public static let shared = VEB(code: "VEB") + } + + /// Currency VEF + public final class VEF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.VEF + public static let shared = VEF(code: "VEF") + } + + /// Currency VND + public final class VND: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.VND + public static let shared = VND(code: "VND") + } + + /// Currency VNN + public final class VNN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.VNN + public static let shared = VNN(code: "VNN") + } + + /// Currency VUV + public final class VUV: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.VUV + public static let shared = VUV(code: "VUV") + } + + /// Currency WST + public final class WST: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.WST + public static let shared = WST(code: "WST") + } + + /// Currency XAF + public final class XAF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XAF + public static let shared = XAF(code: "XAF") + } + + /// Currency XAG + public final class XAG: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XAG + public static let shared = XAG(code: "XAG") + } + + /// Currency XAU + public final class XAU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XAU + public static let shared = XAU(code: "XAU") + } + + /// Currency XBA + public final class XBA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XBA + public static let shared = XBA(code: "XBA") + } + + /// Currency XBB + public final class XBB: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XBB + public static let shared = XBB(code: "XBB") + } + + /// Currency XBC + public final class XBC: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XBC + public static let shared = XBC(code: "XBC") + } + + /// Currency XBD + public final class XBD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XBD + public static let shared = XBD(code: "XBD") + } + + /// Currency XCD + public final class XCD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XCD + public static let shared = XCD(code: "XCD") + } + + /// Currency XDR + public final class XDR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XDR + public static let shared = XDR(code: "XDR") + } + + /// Currency XEU + public final class XEU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XEU + public static let shared = XEU(code: "XEU") + } + + /// Currency XFO + public final class XFO: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XFO + public static let shared = XFO(code: "XFO") + } + + /// Currency XFU + public final class XFU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XFU + public static let shared = XFU(code: "XFU") + } + + /// Currency XOF + public final class XOF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XOF + public static let shared = XOF(code: "XOF") + } + + /// Currency XPD + public final class XPD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XPD + public static let shared = XPD(code: "XPD") + } + + /// Currency XPF + public final class XPF: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XPF + public static let shared = XPF(code: "XPF") + } + + /// Currency XPT + public final class XPT: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XPT + public static let shared = XPT(code: "XPT") + } + + /// Currency XRE + public final class XRE: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XRE + public static let shared = XRE(code: "XRE") + } + + /// Currency XSU + public final class XSU: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XSU + public static let shared = XSU(code: "XSU") + } + + /// Currency XTS + public final class XTS: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XTS + public static let shared = XTS(code: "XTS") + } + + /// Currency XUA + public final class XUA: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XUA + public static let shared = XUA(code: "XUA") + } + + /// Currency XXX + public final class XXX: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.XXX + public static let shared = XXX(code: "XXX") + } + + /// Currency YDD + public final class YDD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YDD + public static let shared = YDD(code: "YDD") + } + + /// Currency YER + public final class YER: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YER + public static let shared = YER(code: "YER") + } + + /// Currency YUD + public final class YUD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YUD + public static let shared = YUD(code: "YUD") + } + + /// Currency YUM + public final class YUM: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YUM + public static let shared = YUM(code: "YUM") + } + + /// Currency YUN + public final class YUN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YUN + public static let shared = YUN(code: "YUN") + } + + /// Currency YUR + public final class YUR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.YUR + public static let shared = YUR(code: "YUR") + } + + /// Currency ZAL + public final class ZAL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZAL + public static let shared = ZAL(code: "ZAL") + } + + /// Currency ZAR + public final class ZAR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZAR + public static let shared = ZAR(code: "ZAR") + } + + /// Currency ZMK + public final class ZMK: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZMK + public static let shared = ZMK(code: "ZMK") + } + + /// Currency ZMW + public final class ZMW: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZMW + public static let shared = ZMW(code: "ZMW") + } + + /// Currency ZRN + public final class ZRN: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZRN + public static let shared = ZRN(code: "ZRN") + } + + /// Currency ZRZ + public final class ZRZ: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZRZ + public static let shared = ZRZ(code: "ZRZ") + } + + /// Currency ZWL + public final class ZWL: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZWL + public static let shared = ZWL(code: "ZWL") + } + + /// Currency ZWR + public final class ZWR: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZWR + public static let shared = ZWR(code: "ZWR") + } + + /// Currency ZWD + public final class ZWD: BaseCurrency, ISOCurrencyProtocol { + /// - returns: shared instance for Currency.ZWD + public static let shared = ZWD(code: "ZWD") + } } +// MARK: - Money + + /// ADP Money -public typealias ADP = _Money +public typealias ADP = ISOMoney + /// AED Money -public typealias AED = _Money +public typealias AED = ISOMoney + /// AFA Money -public typealias AFA = _Money +public typealias AFA = ISOMoney + /// AFN Money -public typealias AFN = _Money +public typealias AFN = ISOMoney + /// ALK Money -public typealias ALK = _Money +public typealias ALK = ISOMoney + /// ALL Money -public typealias ALL = _Money +public typealias ALL = ISOMoney + /// AMD Money -public typealias AMD = _Money +public typealias AMD = ISOMoney + /// ANG Money -public typealias ANG = _Money +public typealias ANG = ISOMoney + /// AOA Money -public typealias AOA = _Money +public typealias AOA = ISOMoney + /// AOK Money -public typealias AOK = _Money +public typealias AOK = ISOMoney + /// AON Money -public typealias AON = _Money +public typealias AON = ISOMoney + /// AOR Money -public typealias AOR = _Money +public typealias AOR = ISOMoney + /// ARA Money -public typealias ARA = _Money +public typealias ARA = ISOMoney + /// ARL Money -public typealias ARL = _Money +public typealias ARL = ISOMoney + /// ARM Money -public typealias ARM = _Money +public typealias ARM = ISOMoney + /// ARP Money -public typealias ARP = _Money +public typealias ARP = ISOMoney + /// ARS Money -public typealias ARS = _Money +public typealias ARS = ISOMoney + /// ATS Money -public typealias ATS = _Money +public typealias ATS = ISOMoney + /// AUD Money -public typealias AUD = _Money +public typealias AUD = ISOMoney + /// AWG Money -public typealias AWG = _Money +public typealias AWG = ISOMoney + /// AZM Money -public typealias AZM = _Money +public typealias AZM = ISOMoney + /// AZN Money -public typealias AZN = _Money +public typealias AZN = ISOMoney + /// BAD Money -public typealias BAD = _Money +public typealias BAD = ISOMoney + /// BAM Money -public typealias BAM = _Money +public typealias BAM = ISOMoney + /// BAN Money -public typealias BAN = _Money +public typealias BAN = ISOMoney + /// BBD Money -public typealias BBD = _Money +public typealias BBD = ISOMoney + /// BDT Money -public typealias BDT = _Money +public typealias BDT = ISOMoney + /// BEC Money -public typealias BEC = _Money +public typealias BEC = ISOMoney + /// BEF Money -public typealias BEF = _Money +public typealias BEF = ISOMoney + /// BEL Money -public typealias BEL = _Money +public typealias BEL = ISOMoney + /// BGL Money -public typealias BGL = _Money +public typealias BGL = ISOMoney + /// BGM Money -public typealias BGM = _Money +public typealias BGM = ISOMoney + /// BGN Money -public typealias BGN = _Money +public typealias BGN = ISOMoney + /// BGO Money -public typealias BGO = _Money +public typealias BGO = ISOMoney + /// BHD Money -public typealias BHD = _Money +public typealias BHD = ISOMoney + /// BIF Money -public typealias BIF = _Money +public typealias BIF = ISOMoney + /// BMD Money -public typealias BMD = _Money +public typealias BMD = ISOMoney + /// BND Money -public typealias BND = _Money +public typealias BND = ISOMoney + /// BOB Money -public typealias BOB = _Money +public typealias BOB = ISOMoney + /// BOL Money -public typealias BOL = _Money +public typealias BOL = ISOMoney + /// BOP Money -public typealias BOP = _Money +public typealias BOP = ISOMoney + /// BOV Money -public typealias BOV = _Money +public typealias BOV = ISOMoney + /// BRB Money -public typealias BRB = _Money +public typealias BRB = ISOMoney + /// BRC Money -public typealias BRC = _Money +public typealias BRC = ISOMoney + /// BRE Money -public typealias BRE = _Money +public typealias BRE = ISOMoney + /// BRL Money -public typealias BRL = _Money +public typealias BRL = ISOMoney + /// BRN Money -public typealias BRN = _Money +public typealias BRN = ISOMoney + /// BRR Money -public typealias BRR = _Money +public typealias BRR = ISOMoney + /// BRZ Money -public typealias BRZ = _Money +public typealias BRZ = ISOMoney + /// BSD Money -public typealias BSD = _Money +public typealias BSD = ISOMoney + /// BTN Money -public typealias BTN = _Money +public typealias BTN = ISOMoney + /// BUK Money -public typealias BUK = _Money +public typealias BUK = ISOMoney + /// BWP Money -public typealias BWP = _Money +public typealias BWP = ISOMoney + /// BYB Money -public typealias BYB = _Money +public typealias BYB = ISOMoney + /// BYR Money -public typealias BYR = _Money +public typealias BYR = ISOMoney + /// BZD Money -public typealias BZD = _Money +public typealias BZD = ISOMoney + /// CAD Money -public typealias CAD = _Money +public typealias CAD = ISOMoney + /// CDF Money -public typealias CDF = _Money +public typealias CDF = ISOMoney + /// CHE Money -public typealias CHE = _Money +public typealias CHE = ISOMoney + /// CHF Money -public typealias CHF = _Money +public typealias CHF = ISOMoney + /// CHW Money -public typealias CHW = _Money +public typealias CHW = ISOMoney + /// CLE Money -public typealias CLE = _Money +public typealias CLE = ISOMoney + /// CLF Money -public typealias CLF = _Money +public typealias CLF = ISOMoney + /// CLP Money -public typealias CLP = _Money +public typealias CLP = ISOMoney + /// CNX Money -public typealias CNX = _Money +public typealias CNX = ISOMoney + /// CNY Money -public typealias CNY = _Money +public typealias CNY = ISOMoney + /// COP Money -public typealias COP = _Money +public typealias COP = ISOMoney + /// COU Money -public typealias COU = _Money +public typealias COU = ISOMoney + /// CRC Money -public typealias CRC = _Money +public typealias CRC = ISOMoney + /// CSD Money -public typealias CSD = _Money +public typealias CSD = ISOMoney + /// CSK Money -public typealias CSK = _Money +public typealias CSK = ISOMoney + /// CUC Money -public typealias CUC = _Money +public typealias CUC = ISOMoney + /// CUP Money -public typealias CUP = _Money +public typealias CUP = ISOMoney + /// CVE Money -public typealias CVE = _Money +public typealias CVE = ISOMoney + /// CYP Money -public typealias CYP = _Money +public typealias CYP = ISOMoney + /// CZK Money -public typealias CZK = _Money +public typealias CZK = ISOMoney + /// DDM Money -public typealias DDM = _Money +public typealias DDM = ISOMoney + /// DEM Money -public typealias DEM = _Money +public typealias DEM = ISOMoney + /// DJF Money -public typealias DJF = _Money +public typealias DJF = ISOMoney + /// DKK Money -public typealias DKK = _Money +public typealias DKK = ISOMoney + /// DOP Money -public typealias DOP = _Money +public typealias DOP = ISOMoney + /// DZD Money -public typealias DZD = _Money +public typealias DZD = ISOMoney + /// ECS Money -public typealias ECS = _Money +public typealias ECS = ISOMoney + /// ECV Money -public typealias ECV = _Money +public typealias ECV = ISOMoney + /// EEK Money -public typealias EEK = _Money +public typealias EEK = ISOMoney + /// EGP Money -public typealias EGP = _Money +public typealias EGP = ISOMoney + /// EQE Money -public typealias EQE = _Money +public typealias EQE = ISOMoney + /// ERN Money -public typealias ERN = _Money +public typealias ERN = ISOMoney + /// ESA Money -public typealias ESA = _Money +public typealias ESA = ISOMoney + /// ESB Money -public typealias ESB = _Money +public typealias ESB = ISOMoney + /// ESP Money -public typealias ESP = _Money +public typealias ESP = ISOMoney + /// ETB Money -public typealias ETB = _Money +public typealias ETB = ISOMoney + /// EUR Money -public typealias EUR = _Money +public typealias EUR = ISOMoney + /// FIM Money -public typealias FIM = _Money +public typealias FIM = ISOMoney + /// FJD Money -public typealias FJD = _Money +public typealias FJD = ISOMoney + /// FKP Money -public typealias FKP = _Money +public typealias FKP = ISOMoney + /// FRF Money -public typealias FRF = _Money +public typealias FRF = ISOMoney + /// GBP Money -public typealias GBP = _Money +public typealias GBP = ISOMoney + /// GEK Money -public typealias GEK = _Money +public typealias GEK = ISOMoney + /// GEL Money -public typealias GEL = _Money +public typealias GEL = ISOMoney + /// GHC Money -public typealias GHC = _Money +public typealias GHC = ISOMoney + /// GHS Money -public typealias GHS = _Money +public typealias GHS = ISOMoney + /// GIP Money -public typealias GIP = _Money +public typealias GIP = ISOMoney + /// GMD Money -public typealias GMD = _Money +public typealias GMD = ISOMoney + /// GNF Money -public typealias GNF = _Money +public typealias GNF = ISOMoney + /// GNS Money -public typealias GNS = _Money +public typealias GNS = ISOMoney + /// GQE Money -public typealias GQE = _Money +public typealias GQE = ISOMoney + /// GRD Money -public typealias GRD = _Money +public typealias GRD = ISOMoney + /// GTQ Money -public typealias GTQ = _Money +public typealias GTQ = ISOMoney + /// GWE Money -public typealias GWE = _Money +public typealias GWE = ISOMoney + /// GWP Money -public typealias GWP = _Money +public typealias GWP = ISOMoney + /// GYD Money -public typealias GYD = _Money +public typealias GYD = ISOMoney + /// HKD Money -public typealias HKD = _Money +public typealias HKD = ISOMoney + /// HNL Money -public typealias HNL = _Money +public typealias HNL = ISOMoney + /// HRD Money -public typealias HRD = _Money +public typealias HRD = ISOMoney + /// HRK Money -public typealias HRK = _Money +public typealias HRK = ISOMoney + /// HTG Money -public typealias HTG = _Money +public typealias HTG = ISOMoney + /// HUF Money -public typealias HUF = _Money +public typealias HUF = ISOMoney + /// IDR Money -public typealias IDR = _Money +public typealias IDR = ISOMoney + /// IEP Money -public typealias IEP = _Money +public typealias IEP = ISOMoney + /// ILP Money -public typealias ILP = _Money +public typealias ILP = ISOMoney + /// ILR Money -public typealias ILR = _Money +public typealias ILR = ISOMoney + /// ILS Money -public typealias ILS = _Money +public typealias ILS = ISOMoney + /// INR Money -public typealias INR = _Money +public typealias INR = ISOMoney + /// IQD Money -public typealias IQD = _Money +public typealias IQD = ISOMoney + /// IRR Money -public typealias IRR = _Money +public typealias IRR = ISOMoney + /// ISJ Money -public typealias ISJ = _Money +public typealias ISJ = ISOMoney + /// ISK Money -public typealias ISK = _Money +public typealias ISK = ISOMoney + /// ITL Money -public typealias ITL = _Money +public typealias ITL = ISOMoney + /// JMD Money -public typealias JMD = _Money +public typealias JMD = ISOMoney + /// JOD Money -public typealias JOD = _Money +public typealias JOD = ISOMoney + /// JPY Money -public typealias JPY = _Money +public typealias JPY = ISOMoney + /// KES Money -public typealias KES = _Money +public typealias KES = ISOMoney + /// KGS Money -public typealias KGS = _Money +public typealias KGS = ISOMoney + /// KHR Money -public typealias KHR = _Money +public typealias KHR = ISOMoney + /// KMF Money -public typealias KMF = _Money +public typealias KMF = ISOMoney + /// KPW Money -public typealias KPW = _Money +public typealias KPW = ISOMoney + /// KRH Money -public typealias KRH = _Money +public typealias KRH = ISOMoney + /// KRO Money -public typealias KRO = _Money +public typealias KRO = ISOMoney + /// KRW Money -public typealias KRW = _Money +public typealias KRW = ISOMoney + /// KWD Money -public typealias KWD = _Money +public typealias KWD = ISOMoney + /// KYD Money -public typealias KYD = _Money +public typealias KYD = ISOMoney + /// KZT Money -public typealias KZT = _Money +public typealias KZT = ISOMoney + /// LAK Money -public typealias LAK = _Money +public typealias LAK = ISOMoney + /// LBP Money -public typealias LBP = _Money +public typealias LBP = ISOMoney + /// LKR Money -public typealias LKR = _Money +public typealias LKR = ISOMoney + /// LRD Money -public typealias LRD = _Money +public typealias LRD = ISOMoney + /// LSL Money -public typealias LSL = _Money +public typealias LSL = ISOMoney + /// LSM Money -public typealias LSM = _Money +public typealias LSM = ISOMoney + /// LTL Money -public typealias LTL = _Money +public typealias LTL = ISOMoney + /// LTT Money -public typealias LTT = _Money +public typealias LTT = ISOMoney + /// LUC Money -public typealias LUC = _Money +public typealias LUC = ISOMoney + /// LUF Money -public typealias LUF = _Money +public typealias LUF = ISOMoney + /// LUL Money -public typealias LUL = _Money +public typealias LUL = ISOMoney + /// LVL Money -public typealias LVL = _Money +public typealias LVL = ISOMoney + /// LVR Money -public typealias LVR = _Money +public typealias LVR = ISOMoney + /// LYD Money -public typealias LYD = _Money +public typealias LYD = ISOMoney + /// MAD Money -public typealias MAD = _Money +public typealias MAD = ISOMoney + /// MAF Money -public typealias MAF = _Money +public typealias MAF = ISOMoney + /// MCF Money -public typealias MCF = _Money +public typealias MCF = ISOMoney + /// MDC Money -public typealias MDC = _Money +public typealias MDC = ISOMoney + /// MDL Money -public typealias MDL = _Money +public typealias MDL = ISOMoney + /// MGA Money -public typealias MGA = _Money +public typealias MGA = ISOMoney + /// MGF Money -public typealias MGF = _Money +public typealias MGF = ISOMoney + /// MKD Money -public typealias MKD = _Money +public typealias MKD = ISOMoney + /// MKN Money -public typealias MKN = _Money +public typealias MKN = ISOMoney + /// MLF Money -public typealias MLF = _Money +public typealias MLF = ISOMoney + /// MMK Money -public typealias MMK = _Money +public typealias MMK = ISOMoney + /// MNT Money -public typealias MNT = _Money +public typealias MNT = ISOMoney + /// MOP Money -public typealias MOP = _Money +public typealias MOP = ISOMoney + /// MRO Money -public typealias MRO = _Money +public typealias MRO = ISOMoney + /// MTL Money -public typealias MTL = _Money +public typealias MTL = ISOMoney + /// MTP Money -public typealias MTP = _Money +public typealias MTP = ISOMoney + /// MUR Money -public typealias MUR = _Money +public typealias MUR = ISOMoney + /// MVP Money -public typealias MVP = _Money +public typealias MVP = ISOMoney + /// MVR Money -public typealias MVR = _Money +public typealias MVR = ISOMoney + /// MWK Money -public typealias MWK = _Money +public typealias MWK = ISOMoney + /// MXN Money -public typealias MXN = _Money +public typealias MXN = ISOMoney + /// MXP Money -public typealias MXP = _Money +public typealias MXP = ISOMoney + /// MXV Money -public typealias MXV = _Money +public typealias MXV = ISOMoney + /// MYR Money -public typealias MYR = _Money +public typealias MYR = ISOMoney + /// MZE Money -public typealias MZE = _Money +public typealias MZE = ISOMoney + /// MZM Money -public typealias MZM = _Money +public typealias MZM = ISOMoney + /// MZN Money -public typealias MZN = _Money +public typealias MZN = ISOMoney + /// NAD Money -public typealias NAD = _Money +public typealias NAD = ISOMoney + /// NGN Money -public typealias NGN = _Money +public typealias NGN = ISOMoney + /// NIC Money -public typealias NIC = _Money +public typealias NIC = ISOMoney + /// NIO Money -public typealias NIO = _Money +public typealias NIO = ISOMoney + /// NLG Money -public typealias NLG = _Money +public typealias NLG = ISOMoney + /// NOK Money -public typealias NOK = _Money +public typealias NOK = ISOMoney + /// NPR Money -public typealias NPR = _Money +public typealias NPR = ISOMoney + /// NZD Money -public typealias NZD = _Money +public typealias NZD = ISOMoney + /// OMR Money -public typealias OMR = _Money +public typealias OMR = ISOMoney + /// PAB Money -public typealias PAB = _Money +public typealias PAB = ISOMoney + /// PEI Money -public typealias PEI = _Money +public typealias PEI = ISOMoney + /// PEN Money -public typealias PEN = _Money +public typealias PEN = ISOMoney + /// PES Money -public typealias PES = _Money +public typealias PES = ISOMoney + /// PGK Money -public typealias PGK = _Money +public typealias PGK = ISOMoney + /// PHP Money -public typealias PHP = _Money +public typealias PHP = ISOMoney + /// PKR Money -public typealias PKR = _Money +public typealias PKR = ISOMoney + /// PLN Money -public typealias PLN = _Money +public typealias PLN = ISOMoney + /// PLZ Money -public typealias PLZ = _Money +public typealias PLZ = ISOMoney + /// PTE Money -public typealias PTE = _Money +public typealias PTE = ISOMoney + /// PYG Money -public typealias PYG = _Money +public typealias PYG = ISOMoney + /// QAR Money -public typealias QAR = _Money +public typealias QAR = ISOMoney + /// RHD Money -public typealias RHD = _Money +public typealias RHD = ISOMoney + /// ROL Money -public typealias ROL = _Money +public typealias ROL = ISOMoney + /// RON Money -public typealias RON = _Money +public typealias RON = ISOMoney + /// RSD Money -public typealias RSD = _Money +public typealias RSD = ISOMoney + /// RUB Money -public typealias RUB = _Money +public typealias RUB = ISOMoney + /// RUR Money -public typealias RUR = _Money +public typealias RUR = ISOMoney + /// RWF Money -public typealias RWF = _Money +public typealias RWF = ISOMoney + /// SAR Money -public typealias SAR = _Money +public typealias SAR = ISOMoney + /// SBD Money -public typealias SBD = _Money +public typealias SBD = ISOMoney + /// SCR Money -public typealias SCR = _Money +public typealias SCR = ISOMoney + /// SDD Money -public typealias SDD = _Money +public typealias SDD = ISOMoney + /// SDG Money -public typealias SDG = _Money +public typealias SDG = ISOMoney + /// SDP Money -public typealias SDP = _Money +public typealias SDP = ISOMoney + /// SEK Money -public typealias SEK = _Money +public typealias SEK = ISOMoney + /// SGD Money -public typealias SGD = _Money +public typealias SGD = ISOMoney + /// SHP Money -public typealias SHP = _Money +public typealias SHP = ISOMoney + /// SIT Money -public typealias SIT = _Money +public typealias SIT = ISOMoney + /// SKK Money -public typealias SKK = _Money +public typealias SKK = ISOMoney + /// SLL Money -public typealias SLL = _Money +public typealias SLL = ISOMoney + /// SOS Money -public typealias SOS = _Money +public typealias SOS = ISOMoney + /// SRD Money -public typealias SRD = _Money +public typealias SRD = ISOMoney + /// SRG Money -public typealias SRG = _Money +public typealias SRG = ISOMoney + /// SSP Money -public typealias SSP = _Money +public typealias SSP = ISOMoney + /// STD Money -public typealias STD = _Money +public typealias STD = ISOMoney + /// SUR Money -public typealias SUR = _Money +public typealias SUR = ISOMoney + /// SVC Money -public typealias SVC = _Money +public typealias SVC = ISOMoney + /// SYP Money -public typealias SYP = _Money +public typealias SYP = ISOMoney + /// SZL Money -public typealias SZL = _Money +public typealias SZL = ISOMoney + /// THB Money -public typealias THB = _Money +public typealias THB = ISOMoney + /// TJR Money -public typealias TJR = _Money +public typealias TJR = ISOMoney + /// TJS Money -public typealias TJS = _Money +public typealias TJS = ISOMoney + /// TMM Money -public typealias TMM = _Money +public typealias TMM = ISOMoney + /// TMT Money -public typealias TMT = _Money +public typealias TMT = ISOMoney + /// TND Money -public typealias TND = _Money +public typealias TND = ISOMoney + /// TOP Money -public typealias TOP = _Money +public typealias TOP = ISOMoney + /// TPE Money -public typealias TPE = _Money +public typealias TPE = ISOMoney + /// TRL Money -public typealias TRL = _Money +public typealias TRL = ISOMoney + /// TRY Money -public typealias TRY = _Money +public typealias TRY = ISOMoney + /// TTD Money -public typealias TTD = _Money +public typealias TTD = ISOMoney + /// TWD Money -public typealias TWD = _Money +public typealias TWD = ISOMoney + /// TZS Money -public typealias TZS = _Money +public typealias TZS = ISOMoney + /// UAH Money -public typealias UAH = _Money +public typealias UAH = ISOMoney + /// UAK Money -public typealias UAK = _Money +public typealias UAK = ISOMoney + /// UGS Money -public typealias UGS = _Money +public typealias UGS = ISOMoney + /// UGX Money -public typealias UGX = _Money +public typealias UGX = ISOMoney + /// USD Money -public typealias USD = _Money +public typealias USD = ISOMoney + /// USN Money -public typealias USN = _Money +public typealias USN = ISOMoney + /// USS Money -public typealias USS = _Money +public typealias USS = ISOMoney + /// UYI Money -public typealias UYI = _Money -/// UYP Money -public typealias UYP = _Money -/// UYU Money -public typealias UYU = _Money -/// UZS Money -public typealias UZS = _Money -/// VEB Money -public typealias VEB = _Money -/// VEF Money -public typealias VEF = _Money -/// VND Money -public typealias VND = _Money -/// VNN Money -public typealias VNN = _Money -/// VUV Money -public typealias VUV = _Money -/// WST Money -public typealias WST = _Money -/// XAF Money -public typealias XAF = _Money -/// XAG Money -public typealias XAG = _Money -/// XAU Money -public typealias XAU = _Money -/// XBA Money -public typealias XBA = _Money -/// XBB Money -public typealias XBB = _Money -/// XBC Money -public typealias XBC = _Money -/// XBD Money -public typealias XBD = _Money -/// XCD Money -public typealias XCD = _Money -/// XDR Money -public typealias XDR = _Money -/// XEU Money -public typealias XEU = _Money -/// XFO Money -public typealias XFO = _Money -/// XFU Money -public typealias XFU = _Money -/// XOF Money -public typealias XOF = _Money -/// XPD Money -public typealias XPD = _Money -/// XPF Money -public typealias XPF = _Money -/// XPT Money -public typealias XPT = _Money -/// XRE Money -public typealias XRE = _Money -/// XSU Money -public typealias XSU = _Money -/// XTS Money -public typealias XTS = _Money -/// XUA Money -public typealias XUA = _Money -/// XXX Money -public typealias XXX = _Money -/// YDD Money -public typealias YDD = _Money -/// YER Money -public typealias YER = _Money -/// YUD Money -public typealias YUD = _Money -/// YUM Money -public typealias YUM = _Money -/// YUN Money -public typealias YUN = _Money -/// YUR Money -public typealias YUR = _Money -/// ZAL Money -public typealias ZAL = _Money -/// ZAR Money -public typealias ZAR = _Money -/// ZMK Money -public typealias ZMK = _Money -/// ZMW Money -public typealias ZMW = _Money -/// ZRN Money -public typealias ZRN = _Money -/// ZRZ Money -public typealias ZRZ = _Money -/// ZWL Money -public typealias ZWL = _Money -/// ZWR Money -public typealias ZWR = _Money -/// ZWD Money -public typealias ZWD = _Money - - -// MARK: - Country Types - -/** - An enum of countries which speak Afrikaans. -*/ -public enum AfrikaansSpeakingCountry: CountryType { - - /// Namibia is a country which speaks Afrikaans. - case Namibia - /// South Africa is a country which speaks Afrikaans. - case SouthAfrica - - /// - returns: an Array of all the countries which speak Afrikaans - public static let all: [AfrikaansSpeakingCountry] = [ .Namibia, .SouthAfrica ] - - /// - returns: the country identifier of a specific Afrikaans speaking country. - public var countryIdentifier: String { - switch self { - case .Namibia: - return "NA" - case .SouthAfrica: - return "ZA" - } - } -} - -/** - An enum of countries which speak Albanian. -*/ -public enum AlbanianSpeakingCountry: CountryType { - - /// Albania is a country which speaks Albanian. - case Albania - /// Macedonia is a country which speaks Albanian. - case Macedonia - /// Kosovo is a country which speaks Albanian. - case Kosovo - - /// - returns: an Array of all the countries which speak Albanian - public static let all: [AlbanianSpeakingCountry] = [ .Albania, .Macedonia, .Kosovo ] - - /// - returns: the country identifier of a specific Albanian speaking country. - public var countryIdentifier: String { - switch self { - case .Albania: - return "AL" - case .Macedonia: - return "MK" - case .Kosovo: - return "XK" - } - } -} - -/** - An enum of countries which speak Arabic. -*/ -public enum ArabicSpeakingCountry: CountryType { - - /// World is a country which speaks Arabic. - case World - /// United Arab Emirates is a country which speaks Arabic. - case UnitedArabEmirates - /// Bahrain is a country which speaks Arabic. - case Bahrain - /// Djibouti is a country which speaks Arabic. - case Djibouti - /// Algeria is a country which speaks Arabic. - case Algeria - /// Egypt is a country which speaks Arabic. - case Egypt - /// Western Sahara is a country which speaks Arabic. - case WesternSahara - /// Eritrea is a country which speaks Arabic. - case Eritrea - /// Israel is a country which speaks Arabic. - case Israel - /// Iraq is a country which speaks Arabic. - case Iraq - /// Jordan is a country which speaks Arabic. - case Jordan - /// Comoros is a country which speaks Arabic. - case Comoros - /// Kuwait is a country which speaks Arabic. - case Kuwait - /// Lebanon is a country which speaks Arabic. - case Lebanon - /// Libya is a country which speaks Arabic. - case Libya - /// Morocco is a country which speaks Arabic. - case Morocco - /// Mauritania is a country which speaks Arabic. - case Mauritania - /// Oman is a country which speaks Arabic. - case Oman - /// Palestinian Territories is a country which speaks Arabic. - case PalestinianTerritories - /// Qatar is a country which speaks Arabic. - case Qatar - /// Saudi Arabia is a country which speaks Arabic. - case SaudiArabia - /// Sudan is a country which speaks Arabic. - case Sudan - /// Somalia is a country which speaks Arabic. - case Somalia - /// South Sudan is a country which speaks Arabic. - case SouthSudan - /// Syria is a country which speaks Arabic. - case Syria - /// Chad is a country which speaks Arabic. - case Chad - /// Tunisia is a country which speaks Arabic. - case Tunisia - /// Yemen is a country which speaks Arabic. - case Yemen - - /// - returns: an Array of all the countries which speak Arabic - public static let all: [ArabicSpeakingCountry] = [ .World, .UnitedArabEmirates, .Bahrain, .Djibouti, .Algeria, .Egypt, .WesternSahara, .Eritrea, .Israel, .Iraq, .Jordan, .Comoros, .Kuwait, .Lebanon, .Libya, .Morocco, .Mauritania, .Oman, .PalestinianTerritories, .Qatar, .SaudiArabia, .Sudan, .Somalia, .SouthSudan, .Syria, .Chad, .Tunisia, .Yemen ] - - /// - returns: the country identifier of a specific Arabic speaking country. - public var countryIdentifier: String { - switch self { - case .World: - return "001" - case .UnitedArabEmirates: - return "AE" - case .Bahrain: - return "BH" - case .Djibouti: - return "DJ" - case .Algeria: - return "DZ" - case .Egypt: - return "EG" - case .WesternSahara: - return "EH" - case .Eritrea: - return "ER" - case .Israel: - return "IL" - case .Iraq: - return "IQ" - case .Jordan: - return "JO" - case .Comoros: - return "KM" - case .Kuwait: - return "KW" - case .Lebanon: - return "LB" - case .Libya: - return "LY" - case .Morocco: - return "MA" - case .Mauritania: - return "MR" - case .Oman: - return "OM" - case .PalestinianTerritories: - return "PS" - case .Qatar: - return "QA" - case .SaudiArabia: - return "SA" - case .Sudan: - return "SD" - case .Somalia: - return "SO" - case .SouthSudan: - return "SS" - case .Syria: - return "SY" - case .Chad: - return "TD" - case .Tunisia: - return "TN" - case .Yemen: - return "YE" - } - } -} - -/** - An enum of countries which speak Bengali. -*/ -public enum BengaliSpeakingCountry: CountryType { - - /// Bangladesh is a country which speaks Bengali. - case Bangladesh - /// India is a country which speaks Bengali. - case India - - /// - returns: an Array of all the countries which speak Bengali - public static let all: [BengaliSpeakingCountry] = [ .Bangladesh, .India ] - - /// - returns: the country identifier of a specific Bengali speaking country. - public var countryIdentifier: String { - switch self { - case .Bangladesh: - return "BD" - case .India: - return "IN" - } - } -} - -/** - An enum of countries which speak Catalan. -*/ -public enum CatalanSpeakingCountry: CountryType { - - /// Andorra is a country which speaks Catalan. - case Andorra - /// Spain is a country which speaks Catalan. - case Spain - /// France is a country which speaks Catalan. - case France - /// Italy is a country which speaks Catalan. - case Italy - - /// - returns: an Array of all the countries which speak Catalan - public static let all: [CatalanSpeakingCountry] = [ .Andorra, .Spain, .France, .Italy ] - - /// - returns: the country identifier of a specific Catalan speaking country. - public var countryIdentifier: String { - switch self { - case .Andorra: - return "AD" - case .Spain: - return "ES" - case .France: - return "FR" - case .Italy: - return "IT" - } - } -} - -/** - An enum of countries which speak Central Kurdish. -*/ -public enum CentralKurdishSpeakingCountry: CountryType { - - /// Iraq is a country which speaks Central Kurdish. - case Iraq - /// Iran is a country which speaks Central Kurdish. - case Iran - - /// - returns: an Array of all the countries which speak Central Kurdish - public static let all: [CentralKurdishSpeakingCountry] = [ .Iraq, .Iran ] - - /// - returns: the country identifier of a specific Central Kurdish speaking country. - public var countryIdentifier: String { - switch self { - case .Iraq: - return "IQ" - case .Iran: - return "IR" - } - } -} - -/** - An enum of countries which speak Chinese. -*/ -public enum ChineseSpeakingCountry: CountryType { - - /// China is a country which speaks Chinese. - case China - /// Hong Kong (China) is a country which speaks Chinese. - case HongKongChina - /// Macau (China) is a country which speaks Chinese. - case MacauChina - /// Singapore is a country which speaks Chinese. - case Singapore - /// Taiwan is a country which speaks Chinese. - case Taiwan - - /// - returns: an Array of all the countries which speak Chinese - public static let all: [ChineseSpeakingCountry] = [ .China, .HongKongChina, .MacauChina, .Singapore, .Taiwan ] - - /// - returns: the country identifier of a specific Chinese speaking country. - public var countryIdentifier: String { - switch self { - case .China: - return "CN" - case .HongKongChina: - return "HK" - case .MacauChina: - return "MO" - case .Singapore: - return "SG" - case .Taiwan: - return "TW" - } - } -} - -/** - An enum of countries which speak Croatian. -*/ -public enum CroatianSpeakingCountry: CountryType { - - /// Bosnia & Herzegovina is a country which speaks Croatian. - case BosniaHerzegovina - /// Croatia is a country which speaks Croatian. - case Croatia - - /// - returns: an Array of all the countries which speak Croatian - public static let all: [CroatianSpeakingCountry] = [ .BosniaHerzegovina, .Croatia ] - - /// - returns: the country identifier of a specific Croatian speaking country. - public var countryIdentifier: String { - switch self { - case .BosniaHerzegovina: - return "BA" - case .Croatia: - return "HR" - } - } -} - -/** - An enum of countries which speak Danish. -*/ -public enum DanishSpeakingCountry: CountryType { - - /// Denmark is a country which speaks Danish. - case Denmark - /// Greenland is a country which speaks Danish. - case Greenland - - /// - returns: an Array of all the countries which speak Danish - public static let all: [DanishSpeakingCountry] = [ .Denmark, .Greenland ] - - /// - returns: the country identifier of a specific Danish speaking country. - public var countryIdentifier: String { - switch self { - case .Denmark: - return "DK" - case .Greenland: - return "GL" - } - } -} - -/** - An enum of countries which speak Dutch. -*/ -public enum DutchSpeakingCountry: CountryType { - - /// Aruba is a country which speaks Dutch. - case Aruba - /// Belgium is a country which speaks Dutch. - case Belgium - /// Caribbean Netherlands is a country which speaks Dutch. - case CaribbeanNetherlands - /// Curaçao is a country which speaks Dutch. - case Curaçao - /// Netherlands is a country which speaks Dutch. - case Netherlands - /// Suriname is a country which speaks Dutch. - case Suriname - /// Sint Maarten is a country which speaks Dutch. - case SintMaarten - - /// - returns: an Array of all the countries which speak Dutch - public static let all: [DutchSpeakingCountry] = [ .Aruba, .Belgium, .CaribbeanNetherlands, .Curaçao, .Netherlands, .Suriname, .SintMaarten ] - - /// - returns: the country identifier of a specific Dutch speaking country. - public var countryIdentifier: String { - switch self { - case .Aruba: - return "AW" - case .Belgium: - return "BE" - case .CaribbeanNetherlands: - return "BQ" - case .Curaçao: - return "CW" - case .Netherlands: - return "NL" - case .Suriname: - return "SR" - case .SintMaarten: - return "SX" - } - } -} - -/** - An enum of countries which speak English. -*/ -public enum EnglishSpeakingCountry: CountryType { - - /// World is a country which speaks English. - case World - /// Europe is a country which speaks English. - case Europe - /// Andorra is a country which speaks English. - case Andorra - /// Antigua & Barbuda is a country which speaks English. - case AntiguaBarbuda - /// Anguilla is a country which speaks English. - case Anguilla - /// Albania is a country which speaks English. - case Albania - /// American Samoa is a country which speaks English. - case AmericanSamoa - /// Austria is a country which speaks English. - case Austria - /// Australia is a country which speaks English. - case Australia - /// Bosnia & Herzegovina is a country which speaks English. - case BosniaHerzegovina - /// Barbados is a country which speaks English. - case Barbados - /// Belgium is a country which speaks English. - case Belgium - /// Burundi is a country which speaks English. - case Burundi - /// Bermuda is a country which speaks English. - case Bermuda - /// Brazil is a country which speaks English. - case Brazil - /// Bahamas is a country which speaks English. - case Bahamas - /// Botswana is a country which speaks English. - case Botswana - /// Belize is a country which speaks English. - case Belize - /// Canada is a country which speaks English. - case Canada - /// Cocos (Keeling) Islands is a country which speaks English. - case CocosKeelingIslands - /// Switzerland is a country which speaks English. - case Switzerland - /// Cook Islands is a country which speaks English. - case CookIslands - /// Cameroon is a country which speaks English. - case Cameroon - /// China is a country which speaks English. - case China - /// Christmas Island is a country which speaks English. - case ChristmasIsland - /// Cyprus is a country which speaks English. - case Cyprus - /// Czech Republic is a country which speaks English. - case CzechRepublic - /// Germany is a country which speaks English. - case Germany - /// Diego Garcia is a country which speaks English. - case DiegoGarcia - /// Denmark is a country which speaks English. - case Denmark - /// Dominica is a country which speaks English. - case Dominica - /// Estonia is a country which speaks English. - case Estonia - /// Eritrea is a country which speaks English. - case Eritrea - /// Spain is a country which speaks English. - case Spain - /// Finland is a country which speaks English. - case Finland - /// Fiji is a country which speaks English. - case Fiji - /// Falkland Islands is a country which speaks English. - case FalklandIslands - /// Micronesia is a country which speaks English. - case Micronesia - /// France is a country which speaks English. - case France - /// United Kingdom is a country which speaks English. - case UnitedKingdom - /// Grenada is a country which speaks English. - case Grenada - /// Guernsey is a country which speaks English. - case Guernsey - /// Ghana is a country which speaks English. - case Ghana - /// Gibraltar is a country which speaks English. - case Gibraltar - /// Gambia is a country which speaks English. - case Gambia - /// Greece is a country which speaks English. - case Greece - /// Guam is a country which speaks English. - case Guam - /// Guyana is a country which speaks English. - case Guyana - /// Hong Kong (China) is a country which speaks English. - case HongKongChina - /// Croatia is a country which speaks English. - case Croatia - /// Hungary is a country which speaks English. - case Hungary - /// Ireland is a country which speaks English. - case Ireland - /// Israel is a country which speaks English. - case Israel - /// Isle of Man is a country which speaks English. - case IsleOfMan - /// India is a country which speaks English. - case India - /// British Indian Ocean Territory is a country which speaks English. - case BritishIndianOceanTerritory - /// Iceland is a country which speaks English. - case Iceland - /// Italy is a country which speaks English. - case Italy - /// Jersey is a country which speaks English. - case Jersey - /// Jamaica is a country which speaks English. - case Jamaica - /// Japan is a country which speaks English. - case Japan - /// Kenya is a country which speaks English. - case Kenya - /// Kiribati is a country which speaks English. - case Kiribati - /// St. Kitts & Nevis is a country which speaks English. - case StKittsNevis - /// South Korea is a country which speaks English. - case SouthKorea - /// Cayman Islands is a country which speaks English. - case CaymanIslands - /// St. Lucia is a country which speaks English. - case StLucia - /// Liberia is a country which speaks English. - case Liberia - /// Lesotho is a country which speaks English. - case Lesotho - /// Lithuania is a country which speaks English. - case Lithuania - /// Luxembourg is a country which speaks English. - case Luxembourg - /// Latvia is a country which speaks English. - case Latvia - /// Montenegro is a country which speaks English. - case Montenegro - /// Madagascar is a country which speaks English. - case Madagascar - /// Marshall Islands is a country which speaks English. - case MarshallIslands - /// Macau (China) is a country which speaks English. - case MacauChina - /// Northern Mariana Islands is a country which speaks English. - case NorthernMarianaIslands - /// Montserrat is a country which speaks English. - case Montserrat - /// Malta is a country which speaks English. - case Malta - /// Mauritius is a country which speaks English. - case Mauritius - /// Maldives is a country which speaks English. - case Maldives - /// Malawi is a country which speaks English. - case Malawi - /// Malaysia is a country which speaks English. - case Malaysia - /// Namibia is a country which speaks English. - case Namibia - /// Norfolk Island is a country which speaks English. - case NorfolkIsland - /// Nigeria is a country which speaks English. - case Nigeria - /// Netherlands is a country which speaks English. - case Netherlands - /// Norway is a country which speaks English. - case Norway - /// Nauru is a country which speaks English. - case Nauru - /// Niue is a country which speaks English. - case Niue - /// New Zealand is a country which speaks English. - case NewZealand - /// Papua New Guinea is a country which speaks English. - case PapuaNewGuinea - /// Philippines is a country which speaks English. - case Philippines - /// Pakistan is a country which speaks English. - case Pakistan - /// Poland is a country which speaks English. - case Poland - /// Pitcairn Islands is a country which speaks English. - case PitcairnIslands - /// Puerto Rico is a country which speaks English. - case PuertoRico - /// Portugal is a country which speaks English. - case Portugal - /// Palau is a country which speaks English. - case Palau - /// Romania is a country which speaks English. - case Romania - /// Russia is a country which speaks English. - case Russia - /// Rwanda is a country which speaks English. - case Rwanda - /// Solomon Islands is a country which speaks English. - case SolomonIslands - /// Seychelles is a country which speaks English. - case Seychelles - /// Sudan is a country which speaks English. - case Sudan - /// Sweden is a country which speaks English. - case Sweden - /// Singapore is a country which speaks English. - case Singapore - /// St. Helena is a country which speaks English. - case StHelena - /// Slovenia is a country which speaks English. - case Slovenia - /// Slovakia is a country which speaks English. - case Slovakia - /// Sierra Leone is a country which speaks English. - case SierraLeone - /// South Sudan is a country which speaks English. - case SouthSudan - /// Sint Maarten is a country which speaks English. - case SintMaarten - /// Swaziland is a country which speaks English. - case Swaziland - /// Turks & Caicos Islands is a country which speaks English. - case TurksCaicosIslands - /// Tokelau is a country which speaks English. - case Tokelau - /// Tonga is a country which speaks English. - case Tonga - /// Turkey is a country which speaks English. - case Turkey - /// Trinidad & Tobago is a country which speaks English. - case TrinidadTobago - /// Tuvalu is a country which speaks English. - case Tuvalu - /// Taiwan is a country which speaks English. - case Taiwan - /// Tanzania is a country which speaks English. - case Tanzania - /// Uganda is a country which speaks English. - case Uganda - /// U.S. Outlying Islands is a country which speaks English. - case USOutlyingIslands - /// United States is a country which speaks English. - case UnitedStates - /// St. Vincent & Grenadines is a country which speaks English. - case StVincentGrenadines - /// British Virgin Islands is a country which speaks English. - case BritishVirginIslands - /// U.S. Virgin Islands is a country which speaks English. - case USVirginIslands - /// Vanuatu is a country which speaks English. - case Vanuatu - /// Samoa is a country which speaks English. - case Samoa - /// South Africa is a country which speaks English. - case SouthAfrica - /// Zambia is a country which speaks English. - case Zambia - /// Zimbabwe is a country which speaks English. - case Zimbabwe - - /// - returns: an Array of all the countries which speak English - public static let all: [EnglishSpeakingCountry] = [ .World, .Europe, .Andorra, .AntiguaBarbuda, .Anguilla, .Albania, .AmericanSamoa, .Austria, .Australia, .BosniaHerzegovina, .Barbados, .Belgium, .Burundi, .Bermuda, .Brazil, .Bahamas, .Botswana, .Belize, .Canada, .CocosKeelingIslands, .Switzerland, .CookIslands, .Cameroon, .China, .ChristmasIsland, .Cyprus, .CzechRepublic, .Germany, .DiegoGarcia, .Denmark, .Dominica, .Estonia, .Eritrea, .Spain, .Finland, .Fiji, .FalklandIslands, .Micronesia, .France, .UnitedKingdom, .Grenada, .Guernsey, .Ghana, .Gibraltar, .Gambia, .Greece, .Guam, .Guyana, .HongKongChina, .Croatia, .Hungary, .Ireland, .Israel, .IsleOfMan, .India, .BritishIndianOceanTerritory, .Iceland, .Italy, .Jersey, .Jamaica, .Japan, .Kenya, .Kiribati, .StKittsNevis, .SouthKorea, .CaymanIslands, .StLucia, .Liberia, .Lesotho, .Lithuania, .Luxembourg, .Latvia, .Montenegro, .Madagascar, .MarshallIslands, .MacauChina, .NorthernMarianaIslands, .Montserrat, .Malta, .Mauritius, .Maldives, .Malawi, .Malaysia, .Namibia, .NorfolkIsland, .Nigeria, .Netherlands, .Norway, .Nauru, .Niue, .NewZealand, .PapuaNewGuinea, .Philippines, .Pakistan, .Poland, .PitcairnIslands, .PuertoRico, .Portugal, .Palau, .Romania, .Russia, .Rwanda, .SolomonIslands, .Seychelles, .Sudan, .Sweden, .Singapore, .StHelena, .Slovenia, .Slovakia, .SierraLeone, .SouthSudan, .SintMaarten, .Swaziland, .TurksCaicosIslands, .Tokelau, .Tonga, .Turkey, .TrinidadTobago, .Tuvalu, .Taiwan, .Tanzania, .Uganda, .USOutlyingIslands, .UnitedStates, .StVincentGrenadines, .BritishVirginIslands, .USVirginIslands, .Vanuatu, .Samoa, .SouthAfrica, .Zambia, .Zimbabwe ] - - /// - returns: the country identifier of a specific English speaking country. - public var countryIdentifier: String { - switch self { - case .World: - return "001" - case .Europe: - return "150" - case .Andorra: - return "AD" - case .AntiguaBarbuda: - return "AG" - case .Anguilla: - return "AI" - case .Albania: - return "AL" - case .AmericanSamoa: - return "AS" - case .Austria: - return "AT" - case .Australia: - return "AU" - case .BosniaHerzegovina: - return "BA" - case .Barbados: - return "BB" - case .Belgium: - return "BE" - case .Burundi: - return "BI" - case .Bermuda: - return "BM" - case .Brazil: - return "BR" - case .Bahamas: - return "BS" - case .Botswana: - return "BW" - case .Belize: - return "BZ" - case .Canada: - return "CA" - case .CocosKeelingIslands: - return "CC" - case .Switzerland: - return "CH" - case .CookIslands: - return "CK" - case .Cameroon: - return "CM" - case .China: - return "CN" - case .ChristmasIsland: - return "CX" - case .Cyprus: - return "CY" - case .CzechRepublic: - return "CZ" - case .Germany: - return "DE" - case .DiegoGarcia: - return "DG" - case .Denmark: - return "DK" - case .Dominica: - return "DM" - case .Estonia: - return "EE" - case .Eritrea: - return "ER" - case .Spain: - return "ES" - case .Finland: - return "FI" - case .Fiji: - return "FJ" - case .FalklandIslands: - return "FK" - case .Micronesia: - return "FM" - case .France: - return "FR" - case .UnitedKingdom: - return "GB" - case .Grenada: - return "GD" - case .Guernsey: - return "GG" - case .Ghana: - return "GH" - case .Gibraltar: - return "GI" - case .Gambia: - return "GM" - case .Greece: - return "GR" - case .Guam: - return "GU" - case .Guyana: - return "GY" - case .HongKongChina: - return "HK" - case .Croatia: - return "HR" - case .Hungary: - return "HU" - case .Ireland: - return "IE" - case .Israel: - return "IL" - case .IsleOfMan: - return "IM" - case .India: - return "IN" - case .BritishIndianOceanTerritory: - return "IO" - case .Iceland: - return "IS" - case .Italy: - return "IT" - case .Jersey: - return "JE" - case .Jamaica: - return "JM" - case .Japan: - return "JP" - case .Kenya: - return "KE" - case .Kiribati: - return "KI" - case .StKittsNevis: - return "KN" - case .SouthKorea: - return "KR" - case .CaymanIslands: - return "KY" - case .StLucia: - return "LC" - case .Liberia: - return "LR" - case .Lesotho: - return "LS" - case .Lithuania: - return "LT" - case .Luxembourg: - return "LU" - case .Latvia: - return "LV" - case .Montenegro: - return "ME" - case .Madagascar: - return "MG" - case .MarshallIslands: - return "MH" - case .MacauChina: - return "MO" - case .NorthernMarianaIslands: - return "MP" - case .Montserrat: - return "MS" - case .Malta: - return "MT" - case .Mauritius: - return "MU" - case .Maldives: - return "MV" - case .Malawi: - return "MW" - case .Malaysia: - return "MY" - case .Namibia: - return "NA" - case .NorfolkIsland: - return "NF" - case .Nigeria: - return "NG" - case .Netherlands: - return "NL" - case .Norway: - return "NO" - case .Nauru: - return "NR" - case .Niue: - return "NU" - case .NewZealand: - return "NZ" - case .PapuaNewGuinea: - return "PG" - case .Philippines: - return "PH" - case .Pakistan: - return "PK" - case .Poland: - return "PL" - case .PitcairnIslands: - return "PN" - case .PuertoRico: - return "PR" - case .Portugal: - return "PT" - case .Palau: - return "PW" - case .Romania: - return "RO" - case .Russia: - return "RU" - case .Rwanda: - return "RW" - case .SolomonIslands: - return "SB" - case .Seychelles: - return "SC" - case .Sudan: - return "SD" - case .Sweden: - return "SE" - case .Singapore: - return "SG" - case .StHelena: - return "SH" - case .Slovenia: - return "SI" - case .Slovakia: - return "SK" - case .SierraLeone: - return "SL" - case .SouthSudan: - return "SS" - case .SintMaarten: - return "SX" - case .Swaziland: - return "SZ" - case .TurksCaicosIslands: - return "TC" - case .Tokelau: - return "TK" - case .Tonga: - return "TO" - case .Turkey: - return "TR" - case .TrinidadTobago: - return "TT" - case .Tuvalu: - return "TV" - case .Taiwan: - return "TW" - case .Tanzania: - return "TZ" - case .Uganda: - return "UG" - case .USOutlyingIslands: - return "UM" - case .UnitedStates: - return "US" - case .StVincentGrenadines: - return "VC" - case .BritishVirginIslands: - return "VG" - case .USVirginIslands: - return "VI" - case .Vanuatu: - return "VU" - case .Samoa: - return "WS" - case .SouthAfrica: - return "ZA" - case .Zambia: - return "ZM" - case .Zimbabwe: - return "ZW" - } - } -} - -/** - An enum of countries which speak Ewe. -*/ -public enum EweSpeakingCountry: CountryType { - - /// Ghana is a country which speaks Ewe. - case Ghana - /// Togo is a country which speaks Ewe. - case Togo - - /// - returns: an Array of all the countries which speak Ewe - public static let all: [EweSpeakingCountry] = [ .Ghana, .Togo ] - - /// - returns: the country identifier of a specific Ewe speaking country. - public var countryIdentifier: String { - switch self { - case .Ghana: - return "GH" - case .Togo: - return "TG" - } - } -} - -/** - An enum of countries which speak Faroese. -*/ -public enum FaroeseSpeakingCountry: CountryType { - - /// Denmark is a country which speaks Faroese. - case Denmark - /// Faroe Islands is a country which speaks Faroese. - case FaroeIslands - - /// - returns: an Array of all the countries which speak Faroese - public static let all: [FaroeseSpeakingCountry] = [ .Denmark, .FaroeIslands ] - - /// - returns: the country identifier of a specific Faroese speaking country. - public var countryIdentifier: String { - switch self { - case .Denmark: - return "DK" - case .FaroeIslands: - return "FO" - } - } -} - -/** - An enum of countries which speak French. -*/ -public enum FrenchSpeakingCountry: CountryType { - - /// Belgium is a country which speaks French. - case Belgium - /// Burkina Faso is a country which speaks French. - case BurkinaFaso - /// Burundi is a country which speaks French. - case Burundi - /// Benin is a country which speaks French. - case Benin - /// St. Barthélemy is a country which speaks French. - case StBarthélemy - /// Canada is a country which speaks French. - case Canada - /// Congo - Kinshasa is a country which speaks French. - case CongoKinshasa - /// Central African Republic is a country which speaks French. - case CentralAfricanRepublic - /// Congo - Brazzaville is a country which speaks French. - case CongoBrazzaville - /// Switzerland is a country which speaks French. - case Switzerland - /// Côte d’Ivoire is a country which speaks French. - case CôteDivoire - /// Cameroon is a country which speaks French. - case Cameroon - /// Djibouti is a country which speaks French. - case Djibouti - /// Algeria is a country which speaks French. - case Algeria - /// France is a country which speaks French. - case France - /// Gabon is a country which speaks French. - case Gabon - /// French Guiana is a country which speaks French. - case FrenchGuiana - /// Guinea is a country which speaks French. - case Guinea - /// Guadeloupe is a country which speaks French. - case Guadeloupe - /// Equatorial Guinea is a country which speaks French. - case EquatorialGuinea - /// Haiti is a country which speaks French. - case Haiti - /// Comoros is a country which speaks French. - case Comoros - /// Luxembourg is a country which speaks French. - case Luxembourg - /// Morocco is a country which speaks French. - case Morocco - /// Monaco is a country which speaks French. - case Monaco - /// St. Martin is a country which speaks French. - case StMartin - /// Madagascar is a country which speaks French. - case Madagascar - /// Mali is a country which speaks French. - case Mali - /// Martinique is a country which speaks French. - case Martinique - /// Mauritania is a country which speaks French. - case Mauritania - /// Mauritius is a country which speaks French. - case Mauritius - /// New Caledonia is a country which speaks French. - case NewCaledonia - /// Niger is a country which speaks French. - case Niger - /// French Polynesia is a country which speaks French. - case FrenchPolynesia - /// St. Pierre & Miquelon is a country which speaks French. - case StPierreMiquelon - /// Réunion is a country which speaks French. - case Réunion - /// Rwanda is a country which speaks French. - case Rwanda - /// Seychelles is a country which speaks French. - case Seychelles - /// Senegal is a country which speaks French. - case Senegal - /// Syria is a country which speaks French. - case Syria - /// Chad is a country which speaks French. - case Chad - /// Togo is a country which speaks French. - case Togo - /// Tunisia is a country which speaks French. - case Tunisia - /// Vanuatu is a country which speaks French. - case Vanuatu - /// Wallis & Futuna is a country which speaks French. - case WallisFutuna - /// Mayotte is a country which speaks French. - case Mayotte - - /// - returns: an Array of all the countries which speak French - public static let all: [FrenchSpeakingCountry] = [ .Belgium, .BurkinaFaso, .Burundi, .Benin, .StBarthélemy, .Canada, .CongoKinshasa, .CentralAfricanRepublic, .CongoBrazzaville, .Switzerland, .CôteDivoire, .Cameroon, .Djibouti, .Algeria, .France, .Gabon, .FrenchGuiana, .Guinea, .Guadeloupe, .EquatorialGuinea, .Haiti, .Comoros, .Luxembourg, .Morocco, .Monaco, .StMartin, .Madagascar, .Mali, .Martinique, .Mauritania, .Mauritius, .NewCaledonia, .Niger, .FrenchPolynesia, .StPierreMiquelon, .Réunion, .Rwanda, .Seychelles, .Senegal, .Syria, .Chad, .Togo, .Tunisia, .Vanuatu, .WallisFutuna, .Mayotte ] - - /// - returns: the country identifier of a specific French speaking country. - public var countryIdentifier: String { - switch self { - case .Belgium: - return "BE" - case .BurkinaFaso: - return "BF" - case .Burundi: - return "BI" - case .Benin: - return "BJ" - case .StBarthélemy: - return "BL" - case .Canada: - return "CA" - case .CongoKinshasa: - return "CD" - case .CentralAfricanRepublic: - return "CF" - case .CongoBrazzaville: - return "CG" - case .Switzerland: - return "CH" - case .CôteDivoire: - return "CI" - case .Cameroon: - return "CM" - case .Djibouti: - return "DJ" - case .Algeria: - return "DZ" - case .France: - return "FR" - case .Gabon: - return "GA" - case .FrenchGuiana: - return "GF" - case .Guinea: - return "GN" - case .Guadeloupe: - return "GP" - case .EquatorialGuinea: - return "GQ" - case .Haiti: - return "HT" - case .Comoros: - return "KM" - case .Luxembourg: - return "LU" - case .Morocco: - return "MA" - case .Monaco: - return "MC" - case .StMartin: - return "MF" - case .Madagascar: - return "MG" - case .Mali: - return "ML" - case .Martinique: - return "MQ" - case .Mauritania: - return "MR" - case .Mauritius: - return "MU" - case .NewCaledonia: - return "NC" - case .Niger: - return "NE" - case .FrenchPolynesia: - return "PF" - case .StPierreMiquelon: - return "PM" - case .Réunion: - return "RE" - case .Rwanda: - return "RW" - case .Seychelles: - return "SC" - case .Senegal: - return "SN" - case .Syria: - return "SY" - case .Chad: - return "TD" - case .Togo: - return "TG" - case .Tunisia: - return "TN" - case .Vanuatu: - return "VU" - case .WallisFutuna: - return "WF" - case .Mayotte: - return "YT" - } - } -} - -/** - An enum of countries which speak Fulah. -*/ -public enum FulahSpeakingCountry: CountryType { - - /// Cameroon is a country which speaks Fulah. - case Cameroon - /// Guinea is a country which speaks Fulah. - case Guinea - /// Mauritania is a country which speaks Fulah. - case Mauritania - /// Senegal is a country which speaks Fulah. - case Senegal - - /// - returns: an Array of all the countries which speak Fulah - public static let all: [FulahSpeakingCountry] = [ .Cameroon, .Guinea, .Mauritania, .Senegal ] - - /// - returns: the country identifier of a specific Fulah speaking country. - public var countryIdentifier: String { - switch self { - case .Cameroon: - return "CM" - case .Guinea: - return "GN" - case .Mauritania: - return "MR" - case .Senegal: - return "SN" - } - } -} - -/** - An enum of countries which speak German. -*/ -public enum GermanSpeakingCountry: CountryType { - - /// Austria is a country which speaks German. - case Austria - /// Belgium is a country which speaks German. - case Belgium - /// Switzerland is a country which speaks German. - case Switzerland - /// Germany is a country which speaks German. - case Germany - /// Liechtenstein is a country which speaks German. - case Liechtenstein - /// Luxembourg is a country which speaks German. - case Luxembourg - - /// - returns: an Array of all the countries which speak German - public static let all: [GermanSpeakingCountry] = [ .Austria, .Belgium, .Switzerland, .Germany, .Liechtenstein, .Luxembourg ] - - /// - returns: the country identifier of a specific German speaking country. - public var countryIdentifier: String { - switch self { - case .Austria: - return "AT" - case .Belgium: - return "BE" - case .Switzerland: - return "CH" - case .Germany: - return "DE" - case .Liechtenstein: - return "LI" - case .Luxembourg: - return "LU" - } - } -} - -/** - An enum of countries which speak Greek. -*/ -public enum GreekSpeakingCountry: CountryType { - - /// Cyprus is a country which speaks Greek. - case Cyprus - /// Greece is a country which speaks Greek. - case Greece - - /// - returns: an Array of all the countries which speak Greek - public static let all: [GreekSpeakingCountry] = [ .Cyprus, .Greece ] - - /// - returns: the country identifier of a specific Greek speaking country. - public var countryIdentifier: String { - switch self { - case .Cyprus: - return "CY" - case .Greece: - return "GR" - } - } -} - -/** - An enum of countries which speak Hausa. -*/ -public enum HausaSpeakingCountry: CountryType { - - /// Ghana is a country which speaks Hausa. - case Ghana - /// Niger is a country which speaks Hausa. - case Niger - /// Nigeria is a country which speaks Hausa. - case Nigeria - - /// - returns: an Array of all the countries which speak Hausa - public static let all: [HausaSpeakingCountry] = [ .Ghana, .Niger, .Nigeria ] - - /// - returns: the country identifier of a specific Hausa speaking country. - public var countryIdentifier: String { - switch self { - case .Ghana: - return "GH" - case .Niger: - return "NE" - case .Nigeria: - return "NG" - } - } -} - -/** - An enum of countries which speak Italian. -*/ -public enum ItalianSpeakingCountry: CountryType { - - /// Switzerland is a country which speaks Italian. - case Switzerland - /// Italy is a country which speaks Italian. - case Italy - /// San Marino is a country which speaks Italian. - case SanMarino - - /// - returns: an Array of all the countries which speak Italian - public static let all: [ItalianSpeakingCountry] = [ .Switzerland, .Italy, .SanMarino ] - - /// - returns: the country identifier of a specific Italian speaking country. - public var countryIdentifier: String { - switch self { - case .Switzerland: - return "CH" - case .Italy: - return "IT" - case .SanMarino: - return "SM" - } - } -} - -/** - An enum of countries which speak Korean. -*/ -public enum KoreanSpeakingCountry: CountryType { - - /// North Korea is a country which speaks Korean. - case NorthKorea - /// South Korea is a country which speaks Korean. - case SouthKorea - - /// - returns: an Array of all the countries which speak Korean - public static let all: [KoreanSpeakingCountry] = [ .NorthKorea, .SouthKorea ] - - /// - returns: the country identifier of a specific Korean speaking country. - public var countryIdentifier: String { - switch self { - case .NorthKorea: - return "KP" - case .SouthKorea: - return "KR" - } - } -} - -/** - An enum of countries which speak Lingala. -*/ -public enum LingalaSpeakingCountry: CountryType { - - /// Angola is a country which speaks Lingala. - case Angola - /// Congo - Kinshasa is a country which speaks Lingala. - case CongoKinshasa - /// Central African Republic is a country which speaks Lingala. - case CentralAfricanRepublic - /// Congo - Brazzaville is a country which speaks Lingala. - case CongoBrazzaville - - /// - returns: an Array of all the countries which speak Lingala - public static let all: [LingalaSpeakingCountry] = [ .Angola, .CongoKinshasa, .CentralAfricanRepublic, .CongoBrazzaville ] - - /// - returns: the country identifier of a specific Lingala speaking country. - public var countryIdentifier: String { - switch self { - case .Angola: - return "AO" - case .CongoKinshasa: - return "CD" - case .CentralAfricanRepublic: - return "CF" - case .CongoBrazzaville: - return "CG" - } - } -} - -/** - An enum of countries which speak Malay. -*/ -public enum MalaySpeakingCountry: CountryType { - - /// Brunei is a country which speaks Malay. - case Brunei - /// Malaysia is a country which speaks Malay. - case Malaysia - /// Singapore is a country which speaks Malay. - case Singapore - - /// - returns: an Array of all the countries which speak Malay - public static let all: [MalaySpeakingCountry] = [ .Brunei, .Malaysia, .Singapore ] - - /// - returns: the country identifier of a specific Malay speaking country. - public var countryIdentifier: String { - switch self { - case .Brunei: - return "BN" - case .Malaysia: - return "MY" - case .Singapore: - return "SG" - } - } -} - -/** - An enum of countries which speak Masai. -*/ -public enum MasaiSpeakingCountry: CountryType { - - /// Kenya is a country which speaks Masai. - case Kenya - /// Tanzania is a country which speaks Masai. - case Tanzania - - /// - returns: an Array of all the countries which speak Masai - public static let all: [MasaiSpeakingCountry] = [ .Kenya, .Tanzania ] - - /// - returns: the country identifier of a specific Masai speaking country. - public var countryIdentifier: String { - switch self { - case .Kenya: - return "KE" - case .Tanzania: - return "TZ" - } - } -} - -/** - An enum of countries which speak Nepali. -*/ -public enum NepaliSpeakingCountry: CountryType { - - /// India is a country which speaks Nepali. - case India - /// Nepal is a country which speaks Nepali. - case Nepal - - /// - returns: an Array of all the countries which speak Nepali - public static let all: [NepaliSpeakingCountry] = [ .India, .Nepal ] - - /// - returns: the country identifier of a specific Nepali speaking country. - public var countryIdentifier: String { - switch self { - case .India: - return "IN" - case .Nepal: - return "NP" - } - } -} - -/** - An enum of countries which speak Northern Luri. -*/ -public enum NorthernLuriSpeakingCountry: CountryType { - - /// Iraq is a country which speaks Northern Luri. - case Iraq - /// Iran is a country which speaks Northern Luri. - case Iran - - /// - returns: an Array of all the countries which speak Northern Luri - public static let all: [NorthernLuriSpeakingCountry] = [ .Iraq, .Iran ] - - /// - returns: the country identifier of a specific Northern Luri speaking country. - public var countryIdentifier: String { - switch self { - case .Iraq: - return "IQ" - case .Iran: - return "IR" - } - } -} - -/** - An enum of countries which speak Northern Sami. -*/ -public enum NorthernSamiSpeakingCountry: CountryType { - - /// Finland is a country which speaks Northern Sami. - case Finland - /// Norway is a country which speaks Northern Sami. - case Norway - /// Sweden is a country which speaks Northern Sami. - case Sweden - - /// - returns: an Array of all the countries which speak Northern Sami - public static let all: [NorthernSamiSpeakingCountry] = [ .Finland, .Norway, .Sweden ] - - /// - returns: the country identifier of a specific Northern Sami speaking country. - public var countryIdentifier: String { - switch self { - case .Finland: - return "FI" - case .Norway: - return "NO" - case .Sweden: - return "SE" - } - } -} - -/** - An enum of countries which speak Norwegian Bokmål. -*/ -public enum NorwegianBokmålSpeakingCountry: CountryType { - - /// Norway is a country which speaks Norwegian Bokmål. - case Norway - /// Svalbard & Jan Mayen is a country which speaks Norwegian Bokmål. - case SvalbardJanMayen - - /// - returns: an Array of all the countries which speak Norwegian Bokmål - public static let all: [NorwegianBokmålSpeakingCountry] = [ .Norway, .SvalbardJanMayen ] - - /// - returns: the country identifier of a specific Norwegian Bokmål speaking country. - public var countryIdentifier: String { - switch self { - case .Norway: - return "NO" - case .SvalbardJanMayen: - return "SJ" - } - } -} - -/** - An enum of countries which speak Oromo. -*/ -public enum OromoSpeakingCountry: CountryType { - - /// Ethiopia is a country which speaks Oromo. - case Ethiopia - /// Kenya is a country which speaks Oromo. - case Kenya - - /// - returns: an Array of all the countries which speak Oromo - public static let all: [OromoSpeakingCountry] = [ .Ethiopia, .Kenya ] - - /// - returns: the country identifier of a specific Oromo speaking country. - public var countryIdentifier: String { - switch self { - case .Ethiopia: - return "ET" - case .Kenya: - return "KE" - } - } -} - -/** - An enum of countries which speak Ossetic. -*/ -public enum OsseticSpeakingCountry: CountryType { - - /// Georgia is a country which speaks Ossetic. - case Georgia - /// Russia is a country which speaks Ossetic. - case Russia - - /// - returns: an Array of all the countries which speak Ossetic - public static let all: [OsseticSpeakingCountry] = [ .Georgia, .Russia ] - - /// - returns: the country identifier of a specific Ossetic speaking country. - public var countryIdentifier: String { - switch self { - case .Georgia: - return "GE" - case .Russia: - return "RU" - } - } -} - -/** - An enum of countries which speak Persian. -*/ -public enum PersianSpeakingCountry: CountryType { - - /// Afghanistan is a country which speaks Persian. - case Afghanistan - /// Iran is a country which speaks Persian. - case Iran - - /// - returns: an Array of all the countries which speak Persian - public static let all: [PersianSpeakingCountry] = [ .Afghanistan, .Iran ] - - /// - returns: the country identifier of a specific Persian speaking country. - public var countryIdentifier: String { - switch self { - case .Afghanistan: - return "AF" - case .Iran: - return "IR" - } - } -} - -/** - An enum of countries which speak Portuguese. -*/ -public enum PortugueseSpeakingCountry: CountryType { - - /// Angola is a country which speaks Portuguese. - case Angola - /// Brazil is a country which speaks Portuguese. - case Brazil - /// Cape Verde is a country which speaks Portuguese. - case CapeVerde - /// Guinea-Bissau is a country which speaks Portuguese. - case GuineaBissau - /// Macau (China) is a country which speaks Portuguese. - case MacauChina - /// Mozambique is a country which speaks Portuguese. - case Mozambique - /// Portugal is a country which speaks Portuguese. - case Portugal - /// São Tomé & Príncipe is a country which speaks Portuguese. - case SãoToméPríncipe - /// Timor-Leste is a country which speaks Portuguese. - case TimorLeste - - /// - returns: an Array of all the countries which speak Portuguese - public static let all: [PortugueseSpeakingCountry] = [ .Angola, .Brazil, .CapeVerde, .GuineaBissau, .MacauChina, .Mozambique, .Portugal, .SãoToméPríncipe, .TimorLeste ] - - /// - returns: the country identifier of a specific Portuguese speaking country. - public var countryIdentifier: String { - switch self { - case .Angola: - return "AO" - case .Brazil: - return "BR" - case .CapeVerde: - return "CV" - case .GuineaBissau: - return "GW" - case .MacauChina: - return "MO" - case .Mozambique: - return "MZ" - case .Portugal: - return "PT" - case .SãoToméPríncipe: - return "ST" - case .TimorLeste: - return "TL" - } - } -} - -/** - An enum of countries which speak Punjabi. -*/ -public enum PunjabiSpeakingCountry: CountryType { - - /// India is a country which speaks Punjabi. - case India - /// Pakistan is a country which speaks Punjabi. - case Pakistan - - /// - returns: an Array of all the countries which speak Punjabi - public static let all: [PunjabiSpeakingCountry] = [ .India, .Pakistan ] - - /// - returns: the country identifier of a specific Punjabi speaking country. - public var countryIdentifier: String { - switch self { - case .India: - return "IN" - case .Pakistan: - return "PK" - } - } -} - -/** - An enum of countries which speak Quechua. -*/ -public enum QuechuaSpeakingCountry: CountryType { - - /// Bolivia is a country which speaks Quechua. - case Bolivia - /// Ecuador is a country which speaks Quechua. - case Ecuador - /// Peru is a country which speaks Quechua. - case Peru - - /// - returns: an Array of all the countries which speak Quechua - public static let all: [QuechuaSpeakingCountry] = [ .Bolivia, .Ecuador, .Peru ] - - /// - returns: the country identifier of a specific Quechua speaking country. - public var countryIdentifier: String { - switch self { - case .Bolivia: - return "BO" - case .Ecuador: - return "EC" - case .Peru: - return "PE" - } - } -} - -/** - An enum of countries which speak Romanian. -*/ -public enum RomanianSpeakingCountry: CountryType { - - /// Moldova is a country which speaks Romanian. - case Moldova - /// Romania is a country which speaks Romanian. - case Romania - - /// - returns: an Array of all the countries which speak Romanian - public static let all: [RomanianSpeakingCountry] = [ .Moldova, .Romania ] - - /// - returns: the country identifier of a specific Romanian speaking country. - public var countryIdentifier: String { - switch self { - case .Moldova: - return "MD" - case .Romania: - return "RO" - } - } -} - -/** - An enum of countries which speak Russian. -*/ -public enum RussianSpeakingCountry: CountryType { - - /// Belarus is a country which speaks Russian. - case Belarus - /// Kyrgyzstan is a country which speaks Russian. - case Kyrgyzstan - /// Kazakhstan is a country which speaks Russian. - case Kazakhstan - /// Moldova is a country which speaks Russian. - case Moldova - /// Russia is a country which speaks Russian. - case Russia - /// Ukraine is a country which speaks Russian. - case Ukraine - - /// - returns: an Array of all the countries which speak Russian - public static let all: [RussianSpeakingCountry] = [ .Belarus, .Kyrgyzstan, .Kazakhstan, .Moldova, .Russia, .Ukraine ] - - /// - returns: the country identifier of a specific Russian speaking country. - public var countryIdentifier: String { - switch self { - case .Belarus: - return "BY" - case .Kyrgyzstan: - return "KG" - case .Kazakhstan: - return "KZ" - case .Moldova: - return "MD" - case .Russia: - return "RU" - case .Ukraine: - return "UA" - } - } -} - -/** - An enum of countries which speak Serbian. -*/ -public enum SerbianSpeakingCountry: CountryType { - - /// Bosnia & Herzegovina is a country which speaks Serbian. - case BosniaHerzegovina - /// Montenegro is a country which speaks Serbian. - case Montenegro - /// Serbia is a country which speaks Serbian. - case Serbia - /// Kosovo is a country which speaks Serbian. - case Kosovo - - /// - returns: an Array of all the countries which speak Serbian - public static let all: [SerbianSpeakingCountry] = [ .BosniaHerzegovina, .Montenegro, .Serbia, .Kosovo ] - - /// - returns: the country identifier of a specific Serbian speaking country. - public var countryIdentifier: String { - switch self { - case .BosniaHerzegovina: - return "BA" - case .Montenegro: - return "ME" - case .Serbia: - return "RS" - case .Kosovo: - return "XK" - } - } -} - -/** - An enum of countries which speak Somali. -*/ -public enum SomaliSpeakingCountry: CountryType { - - /// Djibouti is a country which speaks Somali. - case Djibouti - /// Ethiopia is a country which speaks Somali. - case Ethiopia - /// Kenya is a country which speaks Somali. - case Kenya - /// Somalia is a country which speaks Somali. - case Somalia - - /// - returns: an Array of all the countries which speak Somali - public static let all: [SomaliSpeakingCountry] = [ .Djibouti, .Ethiopia, .Kenya, .Somalia ] - - /// - returns: the country identifier of a specific Somali speaking country. - public var countryIdentifier: String { - switch self { - case .Djibouti: - return "DJ" - case .Ethiopia: - return "ET" - case .Kenya: - return "KE" - case .Somalia: - return "SO" - } - } -} - -/** - An enum of countries which speak Spanish. -*/ -public enum SpanishSpeakingCountry: CountryType { - - /// Latin America is a country which speaks Spanish. - case LatinAmerica - /// Argentina is a country which speaks Spanish. - case Argentina - /// Bolivia is a country which speaks Spanish. - case Bolivia - /// Chile is a country which speaks Spanish. - case Chile - /// Colombia is a country which speaks Spanish. - case Colombia - /// Costa Rica is a country which speaks Spanish. - case CostaRica - /// Cuba is a country which speaks Spanish. - case Cuba - /// Dominican Republic is a country which speaks Spanish. - case DominicanRepublic - /// Ceuta & Melilla is a country which speaks Spanish. - case CeutaMelilla - /// Ecuador is a country which speaks Spanish. - case Ecuador - /// Spain is a country which speaks Spanish. - case Spain - /// Equatorial Guinea is a country which speaks Spanish. - case EquatorialGuinea - /// Guatemala is a country which speaks Spanish. - case Guatemala - /// Honduras is a country which speaks Spanish. - case Honduras - /// Canary Islands is a country which speaks Spanish. - case CanaryIslands - /// Mexico is a country which speaks Spanish. - case Mexico - /// Nicaragua is a country which speaks Spanish. - case Nicaragua - /// Panama is a country which speaks Spanish. - case Panama - /// Peru is a country which speaks Spanish. - case Peru - /// Philippines is a country which speaks Spanish. - case Philippines - /// Puerto Rico is a country which speaks Spanish. - case PuertoRico - /// Paraguay is a country which speaks Spanish. - case Paraguay - /// El Salvador is a country which speaks Spanish. - case ElSalvador - /// United States is a country which speaks Spanish. - case UnitedStates - /// Uruguay is a country which speaks Spanish. - case Uruguay - /// Venezuela is a country which speaks Spanish. - case Venezuela - - /// - returns: an Array of all the countries which speak Spanish - public static let all: [SpanishSpeakingCountry] = [ .LatinAmerica, .Argentina, .Bolivia, .Chile, .Colombia, .CostaRica, .Cuba, .DominicanRepublic, .CeutaMelilla, .Ecuador, .Spain, .EquatorialGuinea, .Guatemala, .Honduras, .CanaryIslands, .Mexico, .Nicaragua, .Panama, .Peru, .Philippines, .PuertoRico, .Paraguay, .ElSalvador, .UnitedStates, .Uruguay, .Venezuela ] - - /// - returns: the country identifier of a specific Spanish speaking country. - public var countryIdentifier: String { - switch self { - case .LatinAmerica: - return "419" - case .Argentina: - return "AR" - case .Bolivia: - return "BO" - case .Chile: - return "CL" - case .Colombia: - return "CO" - case .CostaRica: - return "CR" - case .Cuba: - return "CU" - case .DominicanRepublic: - return "DO" - case .CeutaMelilla: - return "EA" - case .Ecuador: - return "EC" - case .Spain: - return "ES" - case .EquatorialGuinea: - return "GQ" - case .Guatemala: - return "GT" - case .Honduras: - return "HN" - case .CanaryIslands: - return "IC" - case .Mexico: - return "MX" - case .Nicaragua: - return "NI" - case .Panama: - return "PA" - case .Peru: - return "PE" - case .Philippines: - return "PH" - case .PuertoRico: - return "PR" - case .Paraguay: - return "PY" - case .ElSalvador: - return "SV" - case .UnitedStates: - return "US" - case .Uruguay: - return "UY" - case .Venezuela: - return "VE" - } - } -} - -/** - An enum of countries which speak Swahili. -*/ -public enum SwahiliSpeakingCountry: CountryType { - - /// Congo - Kinshasa is a country which speaks Swahili. - case CongoKinshasa - /// Kenya is a country which speaks Swahili. - case Kenya - /// Tanzania is a country which speaks Swahili. - case Tanzania - /// Uganda is a country which speaks Swahili. - case Uganda - - /// - returns: an Array of all the countries which speak Swahili - public static let all: [SwahiliSpeakingCountry] = [ .CongoKinshasa, .Kenya, .Tanzania, .Uganda ] - - /// - returns: the country identifier of a specific Swahili speaking country. - public var countryIdentifier: String { - switch self { - case .CongoKinshasa: - return "CD" - case .Kenya: - return "KE" - case .Tanzania: - return "TZ" - case .Uganda: - return "UG" - } - } -} - -/** - An enum of countries which speak Swedish. -*/ -public enum SwedishSpeakingCountry: CountryType { - - /// Åland Islands is a country which speaks Swedish. - case ÅlandIslands - /// Finland is a country which speaks Swedish. - case Finland - /// Sweden is a country which speaks Swedish. - case Sweden - - /// - returns: an Array of all the countries which speak Swedish - public static let all: [SwedishSpeakingCountry] = [ .ÅlandIslands, .Finland, .Sweden ] - - /// - returns: the country identifier of a specific Swedish speaking country. - public var countryIdentifier: String { - switch self { - case .ÅlandIslands: - return "AX" - case .Finland: - return "FI" - case .Sweden: - return "SE" - } - } -} - -/** - An enum of countries which speak Swiss German. -*/ -public enum SwissGermanSpeakingCountry: CountryType { - - /// Switzerland is a country which speaks Swiss German. - case Switzerland - /// France is a country which speaks Swiss German. - case France - /// Liechtenstein is a country which speaks Swiss German. - case Liechtenstein - - /// - returns: an Array of all the countries which speak Swiss German - public static let all: [SwissGermanSpeakingCountry] = [ .Switzerland, .France, .Liechtenstein ] - - /// - returns: the country identifier of a specific Swiss German speaking country. - public var countryIdentifier: String { - switch self { - case .Switzerland: - return "CH" - case .France: - return "FR" - case .Liechtenstein: - return "LI" - } - } -} - -/** - An enum of countries which speak Tamil. -*/ -public enum TamilSpeakingCountry: CountryType { - - /// India is a country which speaks Tamil. - case India - /// Sri Lanka is a country which speaks Tamil. - case SriLanka - /// Malaysia is a country which speaks Tamil. - case Malaysia - /// Singapore is a country which speaks Tamil. - case Singapore - - /// - returns: an Array of all the countries which speak Tamil - public static let all: [TamilSpeakingCountry] = [ .India, .SriLanka, .Malaysia, .Singapore ] - - /// - returns: the country identifier of a specific Tamil speaking country. - public var countryIdentifier: String { - switch self { - case .India: - return "IN" - case .SriLanka: - return "LK" - case .Malaysia: - return "MY" - case .Singapore: - return "SG" - } - } -} - -/** - An enum of countries which speak Teso. -*/ -public enum TesoSpeakingCountry: CountryType { - - /// Kenya is a country which speaks Teso. - case Kenya - /// Uganda is a country which speaks Teso. - case Uganda - - /// - returns: an Array of all the countries which speak Teso - public static let all: [TesoSpeakingCountry] = [ .Kenya, .Uganda ] - - /// - returns: the country identifier of a specific Teso speaking country. - public var countryIdentifier: String { - switch self { - case .Kenya: - return "KE" - case .Uganda: - return "UG" - } - } -} - -/** - An enum of countries which speak Tibetan. -*/ -public enum TibetanSpeakingCountry: CountryType { - - /// China is a country which speaks Tibetan. - case China - /// India is a country which speaks Tibetan. - case India - - /// - returns: an Array of all the countries which speak Tibetan - public static let all: [TibetanSpeakingCountry] = [ .China, .India ] - - /// - returns: the country identifier of a specific Tibetan speaking country. - public var countryIdentifier: String { - switch self { - case .China: - return "CN" - case .India: - return "IN" - } - } -} - -/** - An enum of countries which speak Tigrinya. -*/ -public enum TigrinyaSpeakingCountry: CountryType { - - /// Eritrea is a country which speaks Tigrinya. - case Eritrea - /// Ethiopia is a country which speaks Tigrinya. - case Ethiopia - - /// - returns: an Array of all the countries which speak Tigrinya - public static let all: [TigrinyaSpeakingCountry] = [ .Eritrea, .Ethiopia ] - - /// - returns: the country identifier of a specific Tigrinya speaking country. - public var countryIdentifier: String { - switch self { - case .Eritrea: - return "ER" - case .Ethiopia: - return "ET" - } - } -} - -/** - An enum of countries which speak Turkish. -*/ -public enum TurkishSpeakingCountry: CountryType { - - /// Cyprus is a country which speaks Turkish. - case Cyprus - /// Turkey is a country which speaks Turkish. - case Turkey - - /// - returns: an Array of all the countries which speak Turkish - public static let all: [TurkishSpeakingCountry] = [ .Cyprus, .Turkey ] - - /// - returns: the country identifier of a specific Turkish speaking country. - public var countryIdentifier: String { - switch self { - case .Cyprus: - return "CY" - case .Turkey: - return "TR" - } - } -} - -/** - An enum of countries which speak Urdu. -*/ -public enum UrduSpeakingCountry: CountryType { - - /// India is a country which speaks Urdu. - case India - /// Pakistan is a country which speaks Urdu. - case Pakistan - - /// - returns: an Array of all the countries which speak Urdu - public static let all: [UrduSpeakingCountry] = [ .India, .Pakistan ] - - /// - returns: the country identifier of a specific Urdu speaking country. - public var countryIdentifier: String { - switch self { - case .India: - return "IN" - case .Pakistan: - return "PK" - } - } -} - -/** - An enum of countries which speak Uzbek. -*/ -public enum UzbekSpeakingCountry: CountryType { - - /// Afghanistan is a country which speaks Uzbek. - case Afghanistan - /// Uzbekistan is a country which speaks Uzbek. - case Uzbekistan - - /// - returns: an Array of all the countries which speak Uzbek - public static let all: [UzbekSpeakingCountry] = [ .Afghanistan, .Uzbekistan ] - - /// - returns: the country identifier of a specific Uzbek speaking country. - public var countryIdentifier: String { - switch self { - case .Afghanistan: - return "AF" - case .Uzbekistan: - return "UZ" - } - } -} - -/** - An enum of countries which speak Yoruba. -*/ -public enum YorubaSpeakingCountry: CountryType { - - /// Benin is a country which speaks Yoruba. - case Benin - /// Nigeria is a country which speaks Yoruba. - case Nigeria - - /// - returns: an Array of all the countries which speak Yoruba - public static let all: [YorubaSpeakingCountry] = [ .Benin, .Nigeria ] - - /// - returns: the country identifier of a specific Yoruba speaking country. - public var countryIdentifier: String { - switch self { - case .Benin: - return "BJ" - case .Nigeria: - return "NG" - } - } -} - -// MARK: - Locale - -/** - -Locale is an enum for type safe representation -of locale identifiers. Its cases are languages -in US English. For languages which are spoken -in more than one country, an associated value -of the country should be provided. For example - -```swift -let locale: MNYLocale = .French(.France) -``` -*/ -public enum MNYLocale { - - /** - ### Afrikaans - - requires: AfrikaansSpeakingCountry - */ - case Afrikaans(AfrikaansSpeakingCountry) - - /// ### Aghem - case Aghem - - /// ### Akan - case Akan - - /** - ### Albanian - - requires: AlbanianSpeakingCountry - */ - case Albanian(AlbanianSpeakingCountry) - - /// ### Amharic - case Amharic - - /** - ### Arabic - - requires: ArabicSpeakingCountry - */ - case Arabic(ArabicSpeakingCountry) - - /// ### Armenian - case Armenian - - /// ### Assamese - case Assamese - - /// ### Asturian - case Asturian - - /// ### Asu - case Asu - - /// ### Azerbaijani - case Azerbaijani +public typealias UYI = ISOMoney - /// ### Bafia - case Bafia - - /// ### Bambara - case Bambara - - /// ### Basaa - case Basaa - - /// ### Basque - case Basque - - /// ### Belarusian - case Belarusian - - /// ### Bemba - case Bemba - - /// ### Bena - case Bena - - /** - ### Bengali - - requires: BengaliSpeakingCountry - */ - case Bengali(BengaliSpeakingCountry) - - /// ### Bodo - case Bodo - - /// ### Bosnian - case Bosnian - - /// ### Breton - case Breton - - /// ### Bulgarian - case Bulgarian - - /// ### Burmese - case Burmese - - /// ### Cantonese - case Cantonese - - /** - ### Catalan - - requires: CatalanSpeakingCountry - */ - case Catalan(CatalanSpeakingCountry) - - /// ### Central Atlas Tamazight - case CentralAtlasTamazight - - /** - ### Central Kurdish - - requires: CentralKurdishSpeakingCountry - */ - case CentralKurdish(CentralKurdishSpeakingCountry) - - /// ### Chechen - case Chechen - - /// ### Cherokee - case Cherokee - - /// ### Chiga - case Chiga - - /** - ### Chinese - - requires: ChineseSpeakingCountry - */ - case Chinese(ChineseSpeakingCountry) - - /// ### Colognian - case Colognian - - /// ### Cornish - case Cornish - - /** - ### Croatian - - requires: CroatianSpeakingCountry - */ - case Croatian(CroatianSpeakingCountry) - - /// ### Czech - case Czech - - /** - ### Danish - - requires: DanishSpeakingCountry - */ - case Danish(DanishSpeakingCountry) - - /// ### Duala - case Duala - - /** - ### Dutch - - requires: DutchSpeakingCountry - */ - case Dutch(DutchSpeakingCountry) - - /// ### Dzongkha - case Dzongkha - - /// ### Embu - case Embu - - /** - ### English - - requires: EnglishSpeakingCountry - */ - case English(EnglishSpeakingCountry) - - /// ### Estonian - case Estonian - - /** - ### Ewe - - requires: EweSpeakingCountry - */ - case Ewe(EweSpeakingCountry) - - /// ### Ewondo - case Ewondo - - /** - ### Faroese - - requires: FaroeseSpeakingCountry - */ - case Faroese(FaroeseSpeakingCountry) - - /// ### Filipino - case Filipino - - /// ### Finnish - case Finnish - - /** - ### French - - requires: FrenchSpeakingCountry - */ - case French(FrenchSpeakingCountry) - - /// ### Friulian - case Friulian - - /** - ### Fulah - - requires: FulahSpeakingCountry - */ - case Fulah(FulahSpeakingCountry) - - /// ### Galician - case Galician - - /// ### Ganda - case Ganda - - /// ### Georgian - case Georgian - - /** - ### German - - requires: GermanSpeakingCountry - */ - case German(GermanSpeakingCountry) - - /** - ### Greek - - requires: GreekSpeakingCountry - */ - case Greek(GreekSpeakingCountry) - - /// ### Gujarati - case Gujarati - - /// ### Gusii - case Gusii - - /** - ### Hausa - - requires: HausaSpeakingCountry - */ - case Hausa(HausaSpeakingCountry) - - /// ### Hawaiian - case Hawaiian - - /// ### Hebrew - case Hebrew - - /// ### Hindi - case Hindi - - /// ### Hungarian - case Hungarian - - /// ### Icelandic - case Icelandic - - /// ### Igbo - case Igbo - - /// ### Inari Sami - case InariSami - - /// ### Indonesian - case Indonesian - - /// ### Inuktitut - case Inuktitut - - /// ### Irish - case Irish - - /** - ### Italian - - requires: ItalianSpeakingCountry - */ - case Italian(ItalianSpeakingCountry) - - /// ### Japanese - case Japanese - - /// ### Jola-Fonyi - case JolaFonyi - - /// ### Kabuverdianu - case Kabuverdianu - - /// ### Kabyle - case Kabyle - - /// ### Kako - case Kako - - /// ### Kalaallisut - case Kalaallisut - - /// ### Kalenjin - case Kalenjin - - /// ### Kamba - case Kamba - - /// ### Kannada - case Kannada - - /// ### Kashmiri - case Kashmiri - - /// ### Kazakh - case Kazakh - - /// ### Khmer - case Khmer - - /// ### Kikuyu - case Kikuyu - - /// ### Kinyarwanda - case Kinyarwanda - - /// ### Konkani - case Konkani - - /** - ### Korean - - requires: KoreanSpeakingCountry - */ - case Korean(KoreanSpeakingCountry) - - /// ### Koyra Chiini - case KoyraChiini - - /// ### Koyraboro Senni - case KoyraboroSenni - - /// ### Kwasio - case Kwasio - - /// ### Kyrgyz - case Kyrgyz - - /// ### Lakota - case Lakota - - /// ### Langi - case Langi - - /// ### Lao - case Lao - - /// ### Latvian - case Latvian - - /** - ### Lingala - - requires: LingalaSpeakingCountry - */ - case Lingala(LingalaSpeakingCountry) - - /// ### Lithuanian - case Lithuanian - - /// ### Lower Sorbian - case LowerSorbian - - /// ### Luba-Katanga - case LubaKatanga - - /// ### Luo - case Luo - - /// ### Luxembourgish - case Luxembourgish - - /// ### Luyia - case Luyia - - /// ### Macedonian - case Macedonian - - /// ### Machame - case Machame - - /// ### Makhuwa-Meetto - case MakhuwaMeetto - - /// ### Makonde - case Makonde - - /// ### Malagasy - case Malagasy - - /** - ### Malay - - requires: MalaySpeakingCountry - */ - case Malay(MalaySpeakingCountry) - - /// ### Malayalam - case Malayalam - - /// ### Maltese - case Maltese - - /// ### Manx - case Manx - - /// ### Marathi - case Marathi - - /** - ### Masai - - requires: MasaiSpeakingCountry - */ - case Masai(MasaiSpeakingCountry) - - /// ### Mazanderani - case Mazanderani - - /// ### Meru - case Meru - - /// ### Metaʼ - case Meta - - /// ### Mongolian - case Mongolian - - /// ### Morisyen - case Morisyen - - /// ### Mundang - case Mundang - - /// ### Nama - case Nama - - /** - ### Nepali - - requires: NepaliSpeakingCountry - */ - case Nepali(NepaliSpeakingCountry) - - /// ### Ngiemboon - case Ngiemboon - - /// ### Ngomba - case Ngomba - - /// ### North Ndebele - case NorthNdebele - - /** - ### Northern Luri - - requires: NorthernLuriSpeakingCountry - */ - case NorthernLuri(NorthernLuriSpeakingCountry) - - /** - ### Northern Sami - - requires: NorthernSamiSpeakingCountry - */ - case NorthernSami(NorthernSamiSpeakingCountry) +/// UYP Money +public typealias UYP = ISOMoney - /** - ### Norwegian Bokmål - - requires: NorwegianBokmålSpeakingCountry - */ - case NorwegianBokmål(NorwegianBokmålSpeakingCountry) +/// UYU Money +public typealias UYU = ISOMoney - /// ### Norwegian Nynorsk - case NorwegianNynorsk +/// UZS Money +public typealias UZS = ISOMoney - /// ### Nuer - case Nuer +/// VEB Money +public typealias VEB = ISOMoney - /// ### Nyankole - case Nyankole +/// VEF Money +public typealias VEF = ISOMoney - /// ### Oriya - case Oriya +/// VND Money +public typealias VND = ISOMoney - /** - ### Oromo - - requires: OromoSpeakingCountry - */ - case Oromo(OromoSpeakingCountry) +/// VNN Money +public typealias VNN = ISOMoney - /** - ### Ossetic - - requires: OsseticSpeakingCountry - */ - case Ossetic(OsseticSpeakingCountry) +/// VUV Money +public typealias VUV = ISOMoney - /// ### Pashto - case Pashto +/// WST Money +public typealias WST = ISOMoney - /** - ### Persian - - requires: PersianSpeakingCountry - */ - case Persian(PersianSpeakingCountry) +/// XAF Money +public typealias XAF = ISOMoney - /// ### Polish - case Polish +/// XAG Money +public typealias XAG = ISOMoney - /** - ### Portuguese - - requires: PortugueseSpeakingCountry - */ - case Portuguese(PortugueseSpeakingCountry) +/// XAU Money +public typealias XAU = ISOMoney - /** - ### Punjabi - - requires: PunjabiSpeakingCountry - */ - case Punjabi(PunjabiSpeakingCountry) +/// XBA Money +public typealias XBA = ISOMoney - /** - ### Quechua - - requires: QuechuaSpeakingCountry - */ - case Quechua(QuechuaSpeakingCountry) - - /** - ### Romanian - - requires: RomanianSpeakingCountry - */ - case Romanian(RomanianSpeakingCountry) - - /// ### Romansh - case Romansh - - /// ### Rombo - case Rombo - - /// ### Rundi - case Rundi - - /** - ### Russian - - requires: RussianSpeakingCountry - */ - case Russian(RussianSpeakingCountry) - - /// ### Rwa - case Rwa - - /// ### Sakha - case Sakha - - /// ### Samburu - case Samburu - - /// ### Sango - case Sango - - /// ### Sangu - case Sangu - - /// ### Scottish Gaelic - case ScottishGaelic - - /// ### Sena - case Sena - - /** - ### Serbian - - requires: SerbianSpeakingCountry - */ - case Serbian(SerbianSpeakingCountry) - - /// ### Shambala - case Shambala - - /// ### Shona - case Shona - - /// ### Sichuan Yi - case SichuanYi - - /// ### Sinhala - case Sinhala - - /// ### Slovak - case Slovak - - /// ### Slovenian - case Slovenian - - /// ### Soga - case Soga - - /** - ### Somali - - requires: SomaliSpeakingCountry - */ - case Somali(SomaliSpeakingCountry) - - /** - ### Spanish - - requires: SpanishSpeakingCountry - */ - case Spanish(SpanishSpeakingCountry) - - /// ### Standard Moroccan Tamazight - case StandardMoroccanTamazight - - /** - ### Swahili - - requires: SwahiliSpeakingCountry - */ - case Swahili(SwahiliSpeakingCountry) +/// XBB Money +public typealias XBB = ISOMoney - /** - ### Swedish - - requires: SwedishSpeakingCountry - */ - case Swedish(SwedishSpeakingCountry) +/// XBC Money +public typealias XBC = ISOMoney - /** - ### Swiss German - - requires: SwissGermanSpeakingCountry - */ - case SwissGerman(SwissGermanSpeakingCountry) +/// XBD Money +public typealias XBD = ISOMoney - /// ### Tachelhit - case Tachelhit +/// XCD Money +public typealias XCD = ISOMoney - /// ### Taita - case Taita +/// XDR Money +public typealias XDR = ISOMoney - /// ### Tajik - case Tajik +/// XEU Money +public typealias XEU = ISOMoney - /** - ### Tamil - - requires: TamilSpeakingCountry - */ - case Tamil(TamilSpeakingCountry) +/// XFO Money +public typealias XFO = ISOMoney - /// ### Tasawaq - case Tasawaq +/// XFU Money +public typealias XFU = ISOMoney - /// ### Telugu - case Telugu +/// XOF Money +public typealias XOF = ISOMoney - /** - ### Teso - - requires: TesoSpeakingCountry - */ - case Teso(TesoSpeakingCountry) +/// XPD Money +public typealias XPD = ISOMoney - /// ### Thai - case Thai +/// XPF Money +public typealias XPF = ISOMoney - /** - ### Tibetan - - requires: TibetanSpeakingCountry - */ - case Tibetan(TibetanSpeakingCountry) +/// XPT Money +public typealias XPT = ISOMoney - /** - ### Tigrinya - - requires: TigrinyaSpeakingCountry - */ - case Tigrinya(TigrinyaSpeakingCountry) +/// XRE Money +public typealias XRE = ISOMoney - /// ### Tongan - case Tongan +/// XSU Money +public typealias XSU = ISOMoney - /** - ### Turkish - - requires: TurkishSpeakingCountry - */ - case Turkish(TurkishSpeakingCountry) +/// XTS Money +public typealias XTS = ISOMoney - /// ### Turkmen - case Turkmen +/// XUA Money +public typealias XUA = ISOMoney - /// ### Ukrainian - case Ukrainian +/// XXX Money +public typealias XXX = ISOMoney - /// ### Upper Sorbian - case UpperSorbian +/// YDD Money +public typealias YDD = ISOMoney - /** - ### Urdu - - requires: UrduSpeakingCountry - */ - case Urdu(UrduSpeakingCountry) - - /// ### Uyghur - case Uyghur - - /** - ### Uzbek - - requires: UzbekSpeakingCountry - */ - case Uzbek(UzbekSpeakingCountry) - - /// ### Vai - case Vai +/// YER Money +public typealias YER = ISOMoney - /// ### Vietnamese - case Vietnamese +/// YUD Money +public typealias YUD = ISOMoney - /// ### Vunjo - case Vunjo +/// YUM Money +public typealias YUM = ISOMoney - /// ### Walser - case Walser +/// YUN Money +public typealias YUN = ISOMoney - /// ### Welsh - case Welsh +/// YUR Money +public typealias YUR = ISOMoney - /// ### Western Frisian - case WesternFrisian +/// ZAL Money +public typealias ZAL = ISOMoney - /// ### Yangben - case Yangben +/// ZAR Money +public typealias ZAR = ISOMoney - /// ### Yiddish - case Yiddish +/// ZMK Money +public typealias ZMK = ISOMoney - /** - ### Yoruba - - requires: YorubaSpeakingCountry - */ - case Yoruba(YorubaSpeakingCountry) +/// ZMW Money +public typealias ZMW = ISOMoney - /// ### Zarma - case Zarma +/// ZRN Money +public typealias ZRN = ISOMoney - /// ### Zulu - case Zulu -} +/// ZRZ Money +public typealias ZRZ = ISOMoney -/** - Locale conforms to LanguageType. -*/ -extension MNYLocale: LanguageType { - - /// - returns: the lanauge identifier as a String. - public var languageIdentifier: String { - switch self { - case .Afrikaans(_): - return "af" - case .Aghem: - return "agq" - case .Akan: - return "ak" - case .Albanian(_): - return "sq" - case .Amharic: - return "am" - case .Arabic(_): - return "ar" - case .Armenian: - return "hy" - case .Assamese: - return "as" - case .Asturian: - return "ast" - case .Asu: - return "asa" - case .Azerbaijani: - return "az" - case .Bafia: - return "ksf" - case .Bambara: - return "bm" - case .Basaa: - return "bas" - case .Basque: - return "eu" - case .Belarusian: - return "be" - case .Bemba: - return "bem" - case .Bena: - return "bez" - case .Bengali(_): - return "bn" - case .Bodo: - return "brx" - case .Bosnian: - return "bs" - case .Breton: - return "br" - case .Bulgarian: - return "bg" - case .Burmese: - return "my" - case .Cantonese: - return "yue" - case .Catalan(_): - return "ca" - case .CentralAtlasTamazight: - return "tzm" - case .CentralKurdish(_): - return "ckb" - case .Chechen: - return "ce" - case .Cherokee: - return "chr" - case .Chiga: - return "cgg" - case .Chinese(_): - return "zh" - case .Colognian: - return "ksh" - case .Cornish: - return "kw" - case .Croatian(_): - return "hr" - case .Czech: - return "cs" - case .Danish(_): - return "da" - case .Duala: - return "dua" - case .Dutch(_): - return "nl" - case .Dzongkha: - return "dz" - case .Embu: - return "ebu" - case .English(_): - return "en" - case .Estonian: - return "et" - case .Ewe(_): - return "ee" - case .Ewondo: - return "ewo" - case .Faroese(_): - return "fo" - case .Filipino: - return "fil" - case .Finnish: - return "fi" - case .French(_): - return "fr" - case .Friulian: - return "fur" - case .Fulah(_): - return "ff" - case .Galician: - return "gl" - case .Ganda: - return "lg" - case .Georgian: - return "ka" - case .German(_): - return "de" - case .Greek(_): - return "el" - case .Gujarati: - return "gu" - case .Gusii: - return "guz" - case .Hausa(_): - return "ha" - case .Hawaiian: - return "haw" - case .Hebrew: - return "he" - case .Hindi: - return "hi" - case .Hungarian: - return "hu" - case .Icelandic: - return "is" - case .Igbo: - return "ig" - case .InariSami: - return "smn" - case .Indonesian: - return "id" - case .Inuktitut: - return "iu" - case .Irish: - return "ga" - case .Italian(_): - return "it" - case .Japanese: - return "ja" - case .JolaFonyi: - return "dyo" - case .Kabuverdianu: - return "kea" - case .Kabyle: - return "kab" - case .Kako: - return "kkj" - case .Kalaallisut: - return "kl" - case .Kalenjin: - return "kln" - case .Kamba: - return "kam" - case .Kannada: - return "kn" - case .Kashmiri: - return "ks" - case .Kazakh: - return "kk" - case .Khmer: - return "km" - case .Kikuyu: - return "ki" - case .Kinyarwanda: - return "rw" - case .Konkani: - return "kok" - case .Korean(_): - return "ko" - case .KoyraChiini: - return "khq" - case .KoyraboroSenni: - return "ses" - case .Kwasio: - return "nmg" - case .Kyrgyz: - return "ky" - case .Lakota: - return "lkt" - case .Langi: - return "lag" - case .Lao: - return "lo" - case .Latvian: - return "lv" - case .Lingala(_): - return "ln" - case .Lithuanian: - return "lt" - case .LowerSorbian: - return "dsb" - case .LubaKatanga: - return "lu" - case .Luo: - return "luo" - case .Luxembourgish: - return "lb" - case .Luyia: - return "luy" - case .Macedonian: - return "mk" - case .Machame: - return "jmc" - case .MakhuwaMeetto: - return "mgh" - case .Makonde: - return "kde" - case .Malagasy: - return "mg" - case .Malay(_): - return "ms" - case .Malayalam: - return "ml" - case .Maltese: - return "mt" - case .Manx: - return "gv" - case .Marathi: - return "mr" - case .Masai(_): - return "mas" - case .Mazanderani: - return "mzn" - case .Meru: - return "mer" - case .Meta: - return "mgo" - case .Mongolian: - return "mn" - case .Morisyen: - return "mfe" - case .Mundang: - return "mua" - case .Nama: - return "naq" - case .Nepali(_): - return "ne" - case .Ngiemboon: - return "nnh" - case .Ngomba: - return "jgo" - case .NorthNdebele: - return "nd" - case .NorthernLuri(_): - return "lrc" - case .NorthernSami(_): - return "se" - case .NorwegianBokmål(_): - return "nb" - case .NorwegianNynorsk: - return "nn" - case .Nuer: - return "nus" - case .Nyankole: - return "nyn" - case .Oriya: - return "or" - case .Oromo(_): - return "om" - case .Ossetic(_): - return "os" - case .Pashto: - return "ps" - case .Persian(_): - return "fa" - case .Polish: - return "pl" - case .Portuguese(_): - return "pt" - case .Punjabi(_): - return "pa" - case .Quechua(_): - return "qu" - case .Romanian(_): - return "ro" - case .Romansh: - return "rm" - case .Rombo: - return "rof" - case .Rundi: - return "rn" - case .Russian(_): - return "ru" - case .Rwa: - return "rwk" - case .Sakha: - return "sah" - case .Samburu: - return "saq" - case .Sango: - return "sg" - case .Sangu: - return "sbp" - case .ScottishGaelic: - return "gd" - case .Sena: - return "seh" - case .Serbian(_): - return "sr" - case .Shambala: - return "ksb" - case .Shona: - return "sn" - case .SichuanYi: - return "ii" - case .Sinhala: - return "si" - case .Slovak: - return "sk" - case .Slovenian: - return "sl" - case .Soga: - return "xog" - case .Somali(_): - return "so" - case .Spanish(_): - return "es" - case .StandardMoroccanTamazight: - return "zgh" - case .Swahili(_): - return "sw" - case .Swedish(_): - return "sv" - case .SwissGerman(_): - return "gsw" - case .Tachelhit: - return "shi" - case .Taita: - return "dav" - case .Tajik: - return "tg" - case .Tamil(_): - return "ta" - case .Tasawaq: - return "twq" - case .Telugu: - return "te" - case .Teso(_): - return "teo" - case .Thai: - return "th" - case .Tibetan(_): - return "bo" - case .Tigrinya(_): - return "ti" - case .Tongan: - return "to" - case .Turkish(_): - return "tr" - case .Turkmen: - return "tk" - case .Ukrainian: - return "uk" - case .UpperSorbian: - return "hsb" - case .Urdu(_): - return "ur" - case .Uyghur: - return "ug" - case .Uzbek(_): - return "uz" - case .Vai: - return "vai" - case .Vietnamese: - return "vi" - case .Vunjo: - return "vun" - case .Walser: - return "wae" - case .Welsh: - return "cy" - case .WesternFrisian: - return "fy" - case .Yangben: - return "yav" - case .Yiddish: - return "yi" - case .Yoruba(_): - return "yo" - case .Zarma: - return "dje" - case .Zulu: - return "zu" - } - } -} +/// ZWL Money +public typealias ZWL = ISOMoney -/** - Locale conforms to CountryType. -*/ -extension MNYLocale: CountryType { - - /// - returns: the country identifier as a String. - public var countryIdentifier: String { - switch self { - case .Aghem, .Akan, .Amharic, .Armenian, .Assamese, .Asturian, .Asu, .Azerbaijani, .Bafia, .Bambara, .Basaa, .Basque, .Belarusian, .Bemba, .Bena, .Bodo, .Bosnian, .Breton, .Bulgarian, .Burmese, .Cantonese, .CentralAtlasTamazight, .Chechen, .Cherokee, .Chiga, .Colognian, .Cornish, .Czech, .Duala, .Dzongkha, .Embu, .Estonian, .Ewondo, .Filipino, .Finnish, .Friulian, .Galician, .Ganda, .Georgian, .Gujarati, .Gusii, .Hawaiian, .Hebrew, .Hindi, .Hungarian, .Icelandic, .Igbo, .InariSami, .Indonesian, .Inuktitut, .Irish, .Japanese, .JolaFonyi, .Kabuverdianu, .Kabyle, .Kako, .Kalaallisut, .Kalenjin, .Kamba, .Kannada, .Kashmiri, .Kazakh, .Khmer, .Kikuyu, .Kinyarwanda, .Konkani, .KoyraChiini, .KoyraboroSenni, .Kwasio, .Kyrgyz, .Lakota, .Langi, .Lao, .Latvian, .Lithuanian, .LowerSorbian, .LubaKatanga, .Luo, .Luxembourgish, .Luyia, .Macedonian, .Machame, .MakhuwaMeetto, .Makonde, .Malagasy, .Malayalam, .Maltese, .Manx, .Marathi, .Mazanderani, .Meru, .Meta, .Mongolian, .Morisyen, .Mundang, .Nama, .Ngiemboon, .Ngomba, .NorthNdebele, .NorwegianNynorsk, .Nuer, .Nyankole, .Oriya, .Pashto, .Polish, .Romansh, .Rombo, .Rundi, .Rwa, .Sakha, .Samburu, .Sango, .Sangu, .ScottishGaelic, .Sena, .Shambala, .Shona, .SichuanYi, .Sinhala, .Slovak, .Slovenian, .Soga, .StandardMoroccanTamazight, .Tachelhit, .Taita, .Tajik, .Tasawaq, .Telugu, .Thai, .Tongan, .Turkmen, .Ukrainian, .UpperSorbian, .Uyghur, .Vai, .Vietnamese, .Vunjo, .Walser, .Welsh, .WesternFrisian, .Yangben, .Yiddish, .Zarma, .Zulu: - return "" - case .Afrikaans(let country): - return country.countryIdentifier - case .Albanian(let country): - return country.countryIdentifier - case .Arabic(let country): - return country.countryIdentifier - case .Bengali(let country): - return country.countryIdentifier - case .Catalan(let country): - return country.countryIdentifier - case .CentralKurdish(let country): - return country.countryIdentifier - case .Chinese(let country): - return country.countryIdentifier - case .Croatian(let country): - return country.countryIdentifier - case .Danish(let country): - return country.countryIdentifier - case .Dutch(let country): - return country.countryIdentifier - case .English(let country): - return country.countryIdentifier - case .Ewe(let country): - return country.countryIdentifier - case .Faroese(let country): - return country.countryIdentifier - case .French(let country): - return country.countryIdentifier - case .Fulah(let country): - return country.countryIdentifier - case .German(let country): - return country.countryIdentifier - case .Greek(let country): - return country.countryIdentifier - case .Hausa(let country): - return country.countryIdentifier - case .Italian(let country): - return country.countryIdentifier - case .Korean(let country): - return country.countryIdentifier - case .Lingala(let country): - return country.countryIdentifier - case .Malay(let country): - return country.countryIdentifier - case .Masai(let country): - return country.countryIdentifier - case .Nepali(let country): - return country.countryIdentifier - case .NorthernLuri(let country): - return country.countryIdentifier - case .NorthernSami(let country): - return country.countryIdentifier - case .NorwegianBokmål(let country): - return country.countryIdentifier - case .Oromo(let country): - return country.countryIdentifier - case .Ossetic(let country): - return country.countryIdentifier - case .Persian(let country): - return country.countryIdentifier - case .Portuguese(let country): - return country.countryIdentifier - case .Punjabi(let country): - return country.countryIdentifier - case .Quechua(let country): - return country.countryIdentifier - case .Romanian(let country): - return country.countryIdentifier - case .Russian(let country): - return country.countryIdentifier - case .Serbian(let country): - return country.countryIdentifier - case .Somali(let country): - return country.countryIdentifier - case .Spanish(let country): - return country.countryIdentifier - case .Swahili(let country): - return country.countryIdentifier - case .Swedish(let country): - return country.countryIdentifier - case .SwissGerman(let country): - return country.countryIdentifier - case .Tamil(let country): - return country.countryIdentifier - case .Teso(let country): - return country.countryIdentifier - case .Tibetan(let country): - return country.countryIdentifier - case .Tigrinya(let country): - return country.countryIdentifier - case .Turkish(let country): - return country.countryIdentifier - case .Urdu(let country): - return country.countryIdentifier - case .Uzbek(let country): - return country.countryIdentifier - case .Yoruba(let country): - return country.countryIdentifier - } - } -} +/// ZWR Money +public typealias ZWR = ISOMoney -extension MNYLocale: LocaleType { - // Uses default implementation -} +/// ZWD Money +public typealias ZWD = ISOMoney diff --git a/Sources/Bitcoin.swift b/Sources/Bitcoin.swift deleted file mode 100644 index 253a108..0000000 --- a/Sources/Bitcoin.swift +++ /dev/null @@ -1,100 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation - - -// MARK: - Bitcoin Currency - -/** - # Bitcoin Currency Type - - BitcoinCurrencyType is a refinement of CryptoCurrencyType, - which allows type restriction when working with Bitcoin. -*/ -public protocol BitcoinCurrencyType: CryptoCurrencyType { } - -public extension BitcoinCurrencyType { - - /// The smallest unit of Bitcoin is the Satoshi - /// - see: https://en.bitcoin.it/wiki/Satoshi_(unit) - static var scale: Int { - return 8 - } - - /// - returns: the currency symbol - static var symbol: String? { - return "Ƀ" - } -} - -public extension Currency { - - /** - # Currency.XBT - This is the ISO 4217 currency code, however at the moment - it is unofficial. - - unicode \u{20bf} was accepted as the Bitcoin currency - symbol in November. However, it's not yet available - on Apple platforms. Ƀ is a popular alternative - which is available. - - */ - struct XBT: BitcoinCurrencyType { - - /// - returns: the proposed ISO 4217 currency code - public static let code = "XBT" - - /// - returns: a configured NSNumberFormatter -// public static let formatter: NSNumberFormatter = { -// let fmtr = NSNumberFormatter() -// fmtr.numberStyle = .CurrencyStyle -// fmtr.maximumFractionDigits = scale -// fmtr.currencySymbol = "Ƀ" -// return fmtr -// }() - } - - /** - # Currency.BTC - This is the common code used for Bitcoin, although it can never become - the ISO standard as BT is the country code for Bhutan. - */ - struct BTC: BitcoinCurrencyType { - public static let code = "BTC" -// public static let scale = Currency.XBT.scale -// public static let formatter = Currency.XBT.formatter - } -} - -/// The proposed ISO 4217 Bitcoin MoneyType -public typealias XBT = _Money - -/// The most commonly used Bitcoin MoneyType -public typealias BTC = _Money - - diff --git a/Sources/Currency.swift b/Sources/Currency.swift index bd7c1bb..4b13993 100644 --- a/Sources/Currency.swift +++ b/Sources/Currency.swift @@ -1,222 +1,68 @@ // -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE // -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. import Foundation -/** - # CurrencyType - This protocol defines the minimum interface needed for a - CurrencyType. - - The interface used to represent a single currency. Note - that it is always used as a generic constraint on other - types. - - Typically framework consumers will not need to conform to - this protocol, unless creating their own currencies. See - the example project "Custom Money" for an example of this. -*/ -public protocol CurrencyType: DecimalNumberBehaviorType { - - /// The currency code - static var code: String { get } - - /// The currency scale - static var scale: Int { get } - - /// The currency symbol - static var symbol: String? { get } - - /// Default formatting style - static var defaultFormattingStyle: NumberFormatter.Style { get } - - static func formatted(withStyle: NumberFormatter.Style, forLocaleId localeId: String) -> (NSDecimalNumber) -> String - - static func formatted(withStyle: NumberFormatter.Style, forLocale locale: MNYLocale) -> (NSDecimalNumber) -> String -} - -public extension CurrencyType { +public struct Currency: CurrencyProtocol { - static var defaultFormattingStyle: NumberFormatter.Style { - return .currency - } - - /** - Default implementation of the `NSDecimalNumberBehaviors` for - the currency. This uses `NSRoundingMode.RoundBankers` and the - scale of the currency as given by the localized formatter. - - - returns: a `NSDecimalNumberBehaviors` - */ - static var decimalNumberBehaviors: NSDecimalNumberBehaviors { - return NSDecimalNumberHandler( - roundingMode: .bankers, - scale: Int16(scale), - raiseOnExactness: true, - raiseOnOverflow: true, - raiseOnUnderflow: true, - raiseOnDivideByZero: true - ) - } - - /** - Use the provided locale identifier to format a supplied NSDecimalNumber. + public let code: String - - returns: a NSDecimalNumber -> String closure. - */ - static func formatted(withStyle style: NumberFormatter.Style, forLocaleId localeId: String) -> (NSDecimalNumber) -> String { - let locale = NSLocale(localeIdentifier: NSLocale.canonicalLocaleIdentifier(from: localeId)) - return formatted(withStyle: style, forLocale: locale) - } - - static func formatted(withStyle style: NumberFormatter.Style, forLocale tmp: NSLocale) -> (NSDecimalNumber) -> String { + public let scale: Int - let id = "\(tmp.localeIdentifier)@currency=\(code)" - let canonical = NSLocale.canonicalLocaleIdentifier(from: id) - let nslocale = NSLocale(localeIdentifier: canonical) - let locale = Locale(identifier: canonical) + public let symbol: String? - let formatter = NumberFormatter() - formatter.currencyCode = code - formatter.locale = locale - formatter.numberStyle = style - formatter.maximumFractionDigits = scale - formatter.currencySymbol = symbol ?? nslocale.mny_currencySymbol - - return { formatter.string(from: $0)! } + init(code: String, scale: Int, symbol: String?) { + self.code = code + self.scale = scale + self.symbol = symbol } - - /** - Use the provided Local to format a supplied NSDecimalNumber. - - - returns: a NSDecimalNumber -> String closure. - */ - static func formatted(withStyle style: NumberFormatter.Style, forLocale locale: MNYLocale) -> (NSDecimalNumber) -> String { - return formatted(withStyle: style, forLocaleId: locale.localeIdentifier) - } -} - -/** - Custom currency types should refine CustomCurrencyType. -*/ -public protocol CustomCurrencyType: CurrencyType { } - -/** - Crypto currency types (Bitcoin etc) should refine CryptoCurrencyType. -*/ -public protocol CryptoCurrencyType: CustomCurrencyType { } - -/** - `ISOCurrencyType` is a refinement of `CurrencyType` so that - the ISO currencies can be autogenerated. -*/ -public protocol ISOCurrencyType: CurrencyType { - - /** - A shared instance of the currency. Note that static - variables are lazily created. - */ - static var sharedInstance: Self { get } - - /// - returns: the currency code - var _code: String { get } - - /// - returns: the currency scale - var _scale: Int { get } - - /// - returns: the currency symbol - var _symbol: String? { get } - } -public extension ISOCurrencyType { +// MARK: - Conformance - /// The currency code - static var code: String { - return sharedInstance._code - } +extension Currency: Equatable { - /// The currency scale - static var scale: Int { - return sharedInstance._scale - } - - /// The currency symbol - static var symbol: String? { - return sharedInstance._symbol - } - - /** - Use the provided locale identifier to format a supplied NSDecimalNumber. - - - returns: a NSDecimalNumber -> String closure. - */ - static func formatted(withStyle style: NumberFormatter.Style, forLocaleId localeId: String) -> (NSDecimalNumber) -> String { - let id = "\(NSLocale.current.identifier)@currency=\(code)" - let locale = NSLocale(localeIdentifier: NSLocale.canonicalLocaleIdentifier(from: id)) - return formatted(withStyle: style, forLocale: locale) + public static func == (lhs: Currency, rhs: Currency) -> Bool { + return lhs.code == rhs.code + && lhs.scale == rhs.scale + && lhs.symbol == rhs.symbol } +} - /** - Use the provided Local to format a supplied NSDecimalNumber. +// MARK: - Base Currency - - returns: a NSDecimalNumber -> String closure. - */ - static func formatted(withStyle style: NumberFormatter.Style, forLocale locale: MNYLocale) -> (NSDecimalNumber) -> String { - let id = "\(locale.localeIdentifier)@currency=\(code)" - let locale = NSLocale(localeIdentifier: NSLocale.canonicalLocaleIdentifier(from: id)) - return formatted(withStyle: style, forLocale: locale) - } -} +extension Currency { -/** - # Currency - A namespace for currency related types. -*/ -public struct Currency { + public class BaseCurrency: CurrencyProtocol, Equatable, CustomStringConvertible { - /** + public static func ==(lhs: BaseCurrency, rhs: BaseCurrency) -> Bool { + return lhs.code == rhs.code + && lhs.scale == rhs.scale + && lhs.symbol == rhs.symbol + } - # Currency.Base - - `Currency.Base` is a class which composes a number formatter - and a locale. It doesn't conform to `CurrencyType` but it can - be used as a base class for currency types which only require - a shared instance. - */ - public class Base { + public let code: String + public let scale: Int + public let symbol: String? - public let _code: String - public let _scale: Int - public let _symbol: String? + public var description: String { + guard let symbol = symbol else { + return "\(code) .\(scale)" + } + return "\(symbol)\(code) .\(scale)" + } init(code: String, scale: Int, symbol: String?) { - _code = code - _scale = scale - _symbol = symbol + self.code = code + self.scale = scale + self.symbol = symbol } convenience init(code: String) { @@ -225,39 +71,32 @@ public struct Currency { let nslocale = NSLocale(localeIdentifier: canonical) let locale = Locale(identifier: canonical) let symbol = nslocale.mny_currencySymbol! - + let fmtr = NumberFormatter() fmtr.locale = locale fmtr.numberStyle = .currency fmtr.currencyCode = code - fmtr.currencySymbol = nslocale.mny_currencySymbol - + fmtr.currencySymbol = symbol + let scale = fmtr.maximumFractionDigits self.init(code: code, scale: scale, symbol: symbol) } - - convenience init(locale: NSLocale) { - let code = locale.mny_currencyCode! - let symbol = locale.mny_currencySymbol - + + convenience init(locale: Locale) { + let code = locale.currencyCode! + let symbol = locale.currencySymbol + let fmtr = NumberFormatter() fmtr.numberStyle = .currency - fmtr.locale = Locale(identifier: locale.localeIdentifier) + fmtr.locale = locale fmtr.currencyCode = code - - let scale = fmtr.maximumFractionDigits + + let scale = fmtr.maximumFractionDigits self.init(code: code, scale: scale, symbol: symbol) } } - /** - - # Currency.Local - - `Currency.Local` is a `BaseCurrency` subclass which represents - the device's current currency, using `NSLocale.currentLocale()`. - */ - public final class Local: Currency.Base, ISOCurrencyType { - public static var sharedInstance = Local(locale: NSLocale.current as NSLocale) + public final class Local: BaseCurrency { + public static var sharedInstance = Local(locale: Locale.current) } } diff --git a/Sources/CurrencyProtocol.swift b/Sources/CurrencyProtocol.swift new file mode 100644 index 0000000..a5a41d0 --- /dev/null +++ b/Sources/CurrencyProtocol.swift @@ -0,0 +1,65 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import Foundation + +/** + # CurrencyProtocol + + This protocol defines the minimum interface needed for + a CurrencyProtocol. + + The interface is used to represent a single currency. + */ +public protocol CurrencyProtocol { + + /// The currency code + var code: String { get } + + /// The currency scale + var scale: Int { get } + + /// The currency symbol + var symbol: String? { get } + + /// Create a number formatter + func numberFormatter(withStyle: NumberFormatter.Style, forLocaleId: String) -> NumberFormatter +} + +public protocol ISOCurrencyProtocol: CurrencyProtocol { + + static var shared: Self { get } +} + + +public extension CurrencyProtocol { + + func numberFormatter(withStyle style: NumberFormatter.Style, forLocaleId localeId: String) -> NumberFormatter { + let canonicalId = Locale.canonicalIdentifier(from: localeId) + let locale = Locale(identifier: "\(canonicalId)@currency=\(code)") + return numberFormatter(withStyle: style, for: locale) + } + + func numberFormatter(withStyle style: NumberFormatter.Style, for locale: Locale) -> NumberFormatter { + + let formatter = NumberFormatter() + formatter.locale = locale + formatter.numberStyle = style + formatter.currencyCode = code + formatter.currencySymbol = symbol ?? locale.currencySymbol + return formatter + } + + func makeDecimalFormatter(withStyle style: NumberFormatter.Style, for locale: Locale) -> (NSDecimalNumber) -> String { + let formatter = numberFormatter(withStyle: style, for: locale) + return { formatter.string(from: $0) ?? $0.description } + } +} + diff --git a/Sources/Decimal+Extensions.swift b/Sources/Decimal+Extensions.swift new file mode 100644 index 0000000..b983ddb --- /dev/null +++ b/Sources/Decimal+Extensions.swift @@ -0,0 +1,50 @@ +// +// Money +// File created on 20/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import Foundation + +extension Decimal { + + func adding(_ other: Decimal) -> Decimal { + var (lhs, rhs) = (self, other) + var result = Decimal() + NSDecimalAdd(&result, &lhs, &rhs, .bankers) + return result + } + + func subtracting(_ other: Decimal) -> Decimal { + var (lhs, rhs) = (self, other) + var result = Decimal() + NSDecimalSubtract(&result, &lhs, &rhs, .bankers) + return result + } + + func multiplying(by other: Decimal) -> Decimal { + var (lhs, rhs) = (self, other) + var result = Decimal() + NSDecimalMultiply(&result, &lhs, &rhs, .bankers) + return result + } + + func multiplying(byPowersOf10 index: Int16) -> Decimal { + var lhs = self + var result = Decimal() + NSDecimalMultiplyByPowerOf10(&result, &lhs, index, .bankers) + return result + } + + func dividing(by other: Decimal) -> Decimal { + var (lhs, rhs) = (self, other) + var result = Decimal() + NSDecimalDivide(&result, &lhs, &rhs, .bankers) + return result + + } +} diff --git a/Sources/Decimal.swift b/Sources/Decimal.swift deleted file mode 100644 index 6945f2e..0000000 --- a/Sources/Decimal.swift +++ /dev/null @@ -1,100 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation -import ValueCoding - -/** - # Decimal - A value type which implements `DecimalNumberType` using `NSDecimalNumber` internally. - - It is generic over the decimal number behavior type, which defines the rounding - and scale rules for base 10 decimal arithmetic. -*/ -public struct _Decimal: DecimalNumberType { - - public typealias DecimalNumberBehavior = Behavior - - /// Access the underlying decimal storage. - /// - returns: the `NSDecimalNumber` - public let storage: NSDecimalNumber - - /** - Initialize a new value using the underlying decimal storage. - - - parameter storage: a `NSDecimalNumber` defaults to zero. - */ - public init(storage: NSDecimalNumber = NSDecimalNumber.zero) { - self.storage = storage - } -} - -// MARK: - Equality - -public func ==(lhs: _Decimal, rhs: _Decimal) -> Bool { - return lhs.storage == rhs.storage -} - -// MARK: - Comparable - -public func <(lhs: _Decimal, rhs: _Decimal) -> Bool { - return lhs.storage < rhs.storage -} - -/// `Decimal` with plain decimal number behavior -public typealias PlainDecimal = _Decimal - -/// `BankersDecimal` with banking decimal number behavior -public typealias BankersDecimal = _Decimal - -// MARK: - Value Coding - -extension _Decimal: ValueCoding { - public typealias Coder = _DecimalCoder -} - -/** - Coding class to support `_Decimal` `ValueCoding` conformance. -*/ -public final class _DecimalCoder: NSObject, NSCoding, CodingProtocol { - - public let value: _Decimal - - public required init(_ v: _Decimal) { - value = v - } - - public init?(coder aDecoder: NSCoder) { - let storage = aDecoder.decodeObject(forKey: "storage") as! NSDecimalNumber - value = _Decimal(storage: storage) - } - - public func encode(with aCoder: NSCoder) { - aCoder.encode(value.storage, forKey: "storage") - } -} - - diff --git a/Sources/DecimalNumberType.swift b/Sources/DecimalNumberType.swift deleted file mode 100644 index d978273..0000000 --- a/Sources/DecimalNumberType.swift +++ /dev/null @@ -1,517 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation - -/** - - # DecimalNumberBehaviorType - - Defines the decimal number behavior, i.e. `NSDecimalNumberBehaviors` - of the type. - - */ -public protocol DecimalNumberBehaviorType { - - /// Specify the decimal number (i.e. rounding, scale etc) for base 10 calculations - static var decimalNumberBehaviors: NSDecimalNumberBehaviors { get } -} - -/** - - # DecimalNumberBehavior - - This is a name space of types which conform to `DecimalNumberBehaviorType` - with common rounding modes. All have maximum precision, of 38 significant - digits. -*/ -public struct DecimalNumberBehavior { - - /// Plain rounding mode - public struct Plain: DecimalNumberBehaviorType { - public static let decimalNumberBehaviors = DecimalNumberBehavior.behavior(withMode: .plain) - } - - /// Round down mode - public struct RoundDown: DecimalNumberBehaviorType { - public static let decimalNumberBehaviors = DecimalNumberBehavior.behavior(withMode: .down) - } - - /// Round up mode - public struct RoundUp: DecimalNumberBehaviorType { - public static let decimalNumberBehaviors = DecimalNumberBehavior.behavior(withMode: .up) - } - - /// Bankers rounding mode, see `NSRoundingMode.RoundBankers` for info. - public struct Bankers: DecimalNumberBehaviorType { - public static let decimalNumberBehaviors = DecimalNumberBehavior.behavior(withMode: .bankers) - } - - private static func behavior(withMode mode: NSDecimalNumber.RoundingMode, scale: Int16 = 38) -> NSDecimalNumberBehaviors { - return NSDecimalNumberHandler(roundingMode: mode, scale: 38, raiseOnExactness: false, raiseOnOverflow: true, raiseOnUnderflow: true, raiseOnDivideByZero: true) - } -} - -/** - - # DecimalNumberType - - A protocol which defines the necessary interface to support decimal number - calculations and operators. - */ -public protocol DecimalNumberType: Hashable, SignedNumber, ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral, CustomStringConvertible { - - associatedtype DecimalStorageType - associatedtype DecimalNumberBehavior: DecimalNumberBehaviorType - - /// Access the underlying storage - var storage: DecimalStorageType { get } - - /// Flag to indicate if the decimal number is less than zero - var isNegative: Bool { get } - - /** - Negates the receiver, equivalent to multiplying it by -1 - - returns: another instance of this type. - */ - var negative: Self { get } - - /// Access an integer value representation - var integerValue: IntegerLiteralType { get } - - /// Access a float value representation - var floatValue: FloatLiteralType { get } - - /** - Initialize a new `DecimalNumberType` with the underlying storage. - This is necessary in order to convert between different decimal number - types. - - - parameter storage: the underlying decimal storage type - e.g. NSDecimalNumber or NSDecimal - */ - init(storage: DecimalStorageType) - - /** - Subtract a matching `DecimalNumberType` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func subtracting(_: Self) -> Self - - /** - Add a matching `DecimalNumberType` to the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func adding(_: Self) -> Self - - /** - Multiply the receive by 10^n - - - parameter n: an `Int` for the 10 power index - - returns: another instance of this type. - */ - func multiplying(byPowerOf10: Int16) -> Self - - /** - Multiply a matching `DecimalNumberType` with the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func multiplying(by: Self) -> Self - - /** - Multiply another `DecimalNumberType` with the receiver. The other - `DecimalNumberType` must have the same underlying `DecimalStorageType` as - this `DecimalNumberType`. - - - parameter other: another `DecimalNumberType` value of different type. - - returns: a different `DecimalNumberType` value. - */ - func multiplying(by: Other) -> Other where Other.DecimalStorageType == DecimalStorageType - - /** - Divide the receiver by a matching `DecimalNumberType`. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func dividing(by: Self) -> Self - - /** - Divide the receiver by another `DecimalNumberType`. The other - `DecimalNumberType` must have the same underlying `DecimalStorageType` as - this `DecimalNumberType`. - - - parameter other: another `DecimalNumberType` value of different type. - - returns: another instance of this type. - */ - func dividing(by: Other) -> Other where Other.DecimalStorageType == DecimalStorageType - - /** - The remainder of dividing another `DecimalNumberType` into the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func remainder(_: Self) -> Self -} - -// MARK: - Extensions - -/** - Extensions on `DecimalNumberType` where the underlying storage type - is `NSDecimalNumber`. - */ -public extension DecimalNumberType where DecimalStorageType == NSDecimalNumber { - - /// Flag to indicate if the decimal number is less than zero - var isNegative: Bool { - return storage.isNegative - } - - /// The negative of Self. - /// - returns: a `_Decimal` - var negative: Self { - return Self(storage: storage.negate(withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /// Access an integer value representation - var integerValue: Int { - return storage.intValue - } - - /// Access a float value representation - var floatValue: Double { - return storage.doubleValue - } - - /// Text description. - var description: String { - return "\(storage.description)" - } - - /// Hash value - var hashValue: Int { - return storage.hashValue - } - - /// Initialize a new decimal with an `Int`. - /// - parameter value: an `Int`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Int) { - switch value { - case 0: - self.init(storage: NSDecimalNumber.zero) - case 1: - self.init(storage: NSDecimalNumber.one) - default: - self.init(storage: NSDecimalNumber(integerLiteral: value).rounding(accordingToBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - } - - /// Initialize a new decimal with an `UInt8`. - /// - parameter value: an `UInt8`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: UInt8) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `Int8`. - /// - parameter value: an `Int8`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Int8) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `UInt16`. - /// - parameter value: an `UInt16`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: UInt16) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `Int16`. - /// - parameter value: an `Int16`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Int16) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `UInt32`. - /// - parameter value: an `UInt32`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: UInt32) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `Int32`. - /// - parameter value: an `Int32`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Int32) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `UInt64`. - /// - parameter value: an `UInt64`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: UInt64) { - self.init(Int(value)) - } - - /// Initialize a new decimal with an `Int64`. - /// - parameter value: an `Int64`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Int64) { - self.init(Int(value)) - } - - /** - Initialize a new value using a `IntegerLiteralType` - - - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. - */ - init(integerLiteral value: Swift.IntegerLiteralType) { - self.init(value) - } - - /// Initialize a new decimal with an `Double`. - /// - parameter value: an `Double`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Double) { - self.init(storage: NSDecimalNumber(floatLiteral: value).rounding(accordingToBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /// Initialize a new decimal with a `Float`. - /// - parameter value: an `Float`. - /// - returns: an initialized `DecimalNumberType`. - init(_ value: Float) { - self.init(Double(value)) - } - - /** - Initialize a new value using a `FloatLiteralType` - - - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. - */ - init(floatLiteral value: Swift.FloatLiteralType) { - self.init(value) - } - - /** - Subtract a matching `DecimalNumberType` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func subtracting(_ other: Self) -> Self { - return Self(storage: storage.subtracting(other.storage, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Add a matching `DecimalNumberType` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func adding(_ other: Self) -> Self { - return Self(storage: storage.adding(other.storage, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Multiply the receive by 10^n - - - parameter n: an `Int` for the 10 power index - - returns: another instance of this type. - */ - func multiplying(byPowerOf10 index: Int16) -> Self { - return Self(storage: storage.multiplying(byPowerOf10: index, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Multiply a matching `DecimalNumberType` with the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func multiplying(by other: Self) -> Self { - return Self(storage: storage.multiplying(by: other.storage, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Multiply a different `DecimalNumberType` which also has `NSDecimalNumber` - as the storage type with the receiver. - - - parameter other: another `DecimalNumberType` with `NSDecimalNumber` storage. - - returns: another instance of this type. - */ - func multiplying(by other: Other) -> Other where Other.DecimalStorageType == NSDecimalNumber { - return Other(storage: storage.multiplying(by: other.storage, withBehavior: Other.DecimalNumberBehavior.decimalNumberBehaviors) ) - } - - /** - Divide the receiver by another instance of this type. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func dividing(by other: Self) -> Self { - return Self(storage: storage.dividing(by: other.storage, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - Divide the receiver by a different `DecimalNumberType` which also has `NSDecimalNumber` - as the storage type. - - - parameter other: another `DecimalNumberType` with `NSDecimalNumber` storage. - - returns: another instance of this type. - */ - func dividing(by other: Other) -> Other where Other.DecimalStorageType == NSDecimalNumber { - return Other(storage: storage.dividing(by: other.storage, withBehavior: Other.DecimalNumberBehavior.decimalNumberBehaviors)) - } - - /** - The remainder of dividing another instance of this type into the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - func remainder(_ other: Self) -> Self { - return Self(storage: storage.remainder(other.storage, withBehavior: DecimalNumberBehavior.decimalNumberBehaviors)) - } -} - -extension DecimalNumberType where Self.IntegerLiteralType == Int { - - /// Get the reciprocal of the receiver. - public var reciprocal: Self { - return Self(integerLiteral: 1).dividing(by: self) - } -} - - -// MARK: - Operators - -// MARK: - Subtraction - -public func -(lhs: T, rhs: T) -> T { - return lhs.subtracting(rhs) -} - -public func -(lhs: T, rhs: T.IntegerLiteralType) -> T { - return lhs - T(integerLiteral: rhs) -} - -public func -(lhs: T.IntegerLiteralType, rhs: T) -> T { - return T(integerLiteral: lhs) - rhs -} - -public func -(lhs: T, rhs: T.FloatLiteralType) -> T { - return lhs - T(floatLiteral: rhs) -} - -public func -(lhs: T.FloatLiteralType, rhs: T) -> T { - return T(floatLiteral: lhs) - rhs -} - -// MARK: - Addition - -public func +(lhs: T, rhs: T) -> T { - return lhs.adding(rhs) -} - -public func +(lhs: T, rhs: T.IntegerLiteralType) -> T { - return lhs + T(integerLiteral: rhs) -} - -public func +(lhs: T.IntegerLiteralType, rhs: T) -> T { - return T(integerLiteral: lhs) + rhs -} - -public func +(lhs: T, rhs: T.FloatLiteralType) -> T { - return lhs + T(floatLiteral: rhs) -} - -public func +(lhs: T.FloatLiteralType, rhs: T) -> T { - return T(floatLiteral: lhs) + rhs -} - -// MARK: - Multiplication - -public func *(lhs: T, rhs: T) -> T { - return lhs.multiplying(by: rhs) -} - -public func *(lhs: T, rhs: T.IntegerLiteralType) -> T { - return lhs * T(integerLiteral: rhs) -} - -public func *(lhs: T, rhs: T.FloatLiteralType) -> T { - return lhs * T(floatLiteral: rhs) -} - -public func *(lhs: T.IntegerLiteralType, rhs: T) -> T { - return rhs * lhs -} - -public func *(lhs: T.FloatLiteralType, rhs: T) -> T { - return rhs * lhs -} - -public func *(lhs: T, rhs: V) -> V where T: DecimalNumberType, V: DecimalNumberType, T.DecimalStorageType == V.DecimalStorageType { - return lhs.multiplying(by: rhs) -} - -// MARK: - Division - -public func /(lhs: T, rhs: T) -> T { - return lhs.dividing(by: rhs) -} - -public func /(lhs: T, rhs: T.IntegerLiteralType) -> T { - return lhs / T(integerLiteral: rhs) -} - -public func /(lhs: T, rhs: T.FloatLiteralType) -> T { - return lhs / T(floatLiteral: rhs) -} - -public func /(lhs: T, rhs: V) -> V where T: DecimalNumberType, V: DecimalNumberType, T.DecimalStorageType == V.DecimalStorageType { - return lhs.dividing(by: rhs) -} - -// MARK: - Remainder - -public func %(lhs: T, rhs: T) -> T { - return lhs.remainder(rhs) -} - - - diff --git a/Sources/ISOMoney.swift b/Sources/ISOMoney.swift new file mode 100644 index 0000000..94bb4b0 --- /dev/null +++ b/Sources/ISOMoney.swift @@ -0,0 +1,94 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import Foundation + +public struct ISOMoney: MoneyProtocol { + + public static func +=(lhs: inout ISOMoney, rhs: ISOMoney) { + let result: ISOMoney = lhs + rhs + lhs.decimal = result.decimal + } + + public static func -=(lhs: inout ISOMoney, rhs: ISOMoney) { + let result: ISOMoney = lhs - rhs + lhs.decimal = result.decimal + } + + public static func *=(lhs: inout ISOMoney, rhs: ISOMoney) { + let result: ISOMoney = lhs * rhs + lhs.decimal = result.decimal + } + + public static func /=(lhs: inout ISOMoney, rhs: ISOMoney) { + let result: ISOMoney = lhs / rhs + lhs.decimal = result.decimal + } + + + public let currency: CurrencyProtocol = C.shared + + public private(set) var decimal: Decimal + + + + public var magnitude: Decimal { + return decimal + } + + + + public init(decimal: Decimal = 0) { + self.decimal = decimal + } + + public init(integerLiteral value: Int) { + self.decimal = Decimal(integerLiteral: value) + } + + public init(floatLiteral value: Double) { + self.decimal = Decimal(floatLiteral: value) + } + + public init?(exactly source: T) where T : BinaryInteger { + guard let _decimal = Decimal(exactly: source) else { return nil } + self.decimal = _decimal + } + + public init(minorUnits: Int) { + self.init(decimal: Decimal(minorUnits).multiplying(byPowersOf10: Int16(C.shared.scale * -1))) + } + +} + +// MARK: - Conformance + +extension ISOMoney: Equatable { + + public static func ==(lhs: ISOMoney, rhs: ISOMoney) -> Bool { + return lhs.decimal == rhs.decimal + && lhs.currency.code == rhs.currency.code + && lhs.currency.scale == rhs.currency.scale + && lhs.currency.symbol == rhs.currency.symbol + } +} + +extension ISOMoney: Comparable { + + public static func <(lhs: ISOMoney, rhs: ISOMoney) -> Bool { + + if lhs.currency.code != rhs.currency.code { + return lhs.currency.code < rhs.currency.code + } + + return lhs.decimal < rhs.decimal + } +} + diff --git a/Sources/Locale.swift b/Sources/Locale.swift deleted file mode 100644 index 737643f..0000000 --- a/Sources/Locale.swift +++ /dev/null @@ -1,112 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import Foundation - -/** - LanguageType provides an interface to retrieve - a language identifier. -*/ -public protocol LanguageType { - - /// - returns: the language identifier as a String - var languageIdentifier: String { get } -} - -/** - CountryType provides an interface to retrieve - a country identifier. - */ -public protocol CountryType { - - /// - returns: the country identifier as a String - var countryIdentifier: String { get } -} - -/** - LocaleType provides an interface to retrieve - a locale identifier. - */ -public protocol LocaleType { - - /// - returns: the locale identifier as a String - var localeIdentifier: String { get } -} - -/** - LocaleType extension for types which also conform to - LanguageType and CountryType. - */ -extension LocaleType where Self: LanguageType, Self: CountryType { - - /** - Default implementation of localeIdentifier, where - if a country identifier is not empty, it is appended to the - language identifier, with an underscore. - - returns: the locale identifier as a String - */ - public var localeIdentifier: String { - guard !countryIdentifier.isEmpty else { - return languageIdentifier - } - return "\(languageIdentifier)_\(countryIdentifier)" - } -} - -/** - Convenience currency related properties on NSLocale -*/ -internal extension NSLocale { - - /// - returns: a String? for the currency code. - var mny_currencyCode: String? { - if #available(iOS 10.0, iOSApplicationExtension 10.0, watchOS 3.0, watchOSApplicationExtension 3.0, tvOS 10.0, tvOSApplicationExtension 10.0, OSX 10.12, OSXApplicationExtension 10.12, *) { - return currencyCode - } else { - return object(forKey: NSLocale.Key.currencyCode) as? String - } - } - - /// - returns: a String? for the currency symbol. - var mny_currencySymbol: String? { - if #available(iOS 10.0, iOSApplicationExtension 10.0, watchOS 3.0, watchOSApplicationExtension 3.0, tvOS 10.0, tvOSApplicationExtension 10.0, OSX 10.12, OSXApplicationExtension 10.12, *) { - return currencySymbol - } else { - return object(forKey: NSLocale.Key.currencySymbol) as? String - } - } - - /// - returns: a String? for the currency grouping separator. - var mny_currencyGroupingSeparator: String? { - return object(forKey: NSLocale.Key.groupingSeparator) as? String - } - - /// - returns: a String? for the currency decimal separator. - var mny_currencyDecimalSeparator: String? { - return object(forKey: NSLocale.Key.decimalSeparator) as? String - } -} - diff --git a/Sources/Money.swift b/Sources/Money.swift index 8a241a8..f6799f1 100644 --- a/Sources/Money.swift +++ b/Sources/Money.swift @@ -1,326 +1,109 @@ // -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE // -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. import Foundation -import ValueCoding - -/** - - # MoneyType - - `MoneyType` is a protocol which refines `DecimalNumberType`. It - adds a generic type for the currency. -*/ -public protocol MoneyType: DecimalNumberType, ValueCoding { - associatedtype Currency: CurrencyType - - /// Access the underlying decimal - var decimal: _Decimal { get } - - /// Access the underlying minor units - var minorUnits: IntegerLiteralType { get } - - /// Initialize the money with a decimal - init(_: _Decimal) - - /// Initialize the money with a integer representing minor units - init(minorUnits: IntegerLiteralType) -} - -public extension MoneyType { - - /// - returns: a String for the currency's international code. - var currencyCode: String { - return Currency.code - } - /// - returns: a String for the currency's symbol in the current locale. - var currencySymbol: String? { - return Currency.symbol - } -} +public struct Money: MoneyProtocol { -public extension MoneyType where DecimalStorageType == NSDecimalNumber { - - /// Convenience access to the "amount" as an NSDecimalNumber. - var amount: DecimalStorageType { - return storage + public static func +=(lhs: inout Money, rhs: Money) { + let result: Money = lhs + rhs + lhs.decimal = result.decimal } - /** - - ### Formatted String - - This function will format the Money type into a string for - the current locale. - - For custom currencies which define their own currency code, - create a lazy static `NSNumberFormatter`. Set the following - properties on it: `currencySymbol`, `internationalCurrencySymbol` - `currencyGroupingSeparator` and `currencyDecimalSeparator`, as they - will be used when formatting the string. Feel free to fall back to - the current locale's values for any of these to maintain - natural looking formatting. See the example project for more. - - - parameter style: the `NSNumberFormatterStyle` to use. - - returns: a localized and formatted string for the money amount. - */ - func formatted(withStyle style: NumberFormatter.Style) -> String { - return Currency.formatted(withStyle: style, forLocaleId: NSLocale.current.identifier)(amount) - } - - /** - - ### Formatted String for specific Locale - - This function will format the Money type into a string suitable - for a specific local. It accepts an parameter for the - style `NSNumberFormatterStyle`. Note that iOS 9 and OS X 10.11 - added new styles which are relevant for currency. - - These are `.CurrencyISOCodeStyle`, `.CurrencyPluralStyle`, and - `.CurrencyAccountingStyle`. - - - parameter style: the `NSNumberFormatterStyle` to use. - - parameter locale: a `MNYLocale` value - - returns: a localized and formatted string for the money amount. - */ - func formatted(withStyle style: NumberFormatter.Style, forLocale locale: MNYLocale) -> String { - return Currency.formatted(withStyle: style, forLocale: locale)(amount) + public static func -=(lhs: inout Money, rhs: Money) { + let result: Money = lhs - rhs + lhs.decimal = result.decimal } -} - -public extension MoneyType where DecimalStorageType == BankersDecimal.DecimalStorageType { - /** - Use a `BankersDecimal` to convert the receive into another `MoneyType`. To use this - API the underlying `DecimalStorageType`s between the receiver, the other `MoneyType` - must both be the same a that of `BankersDecimal` (which luckily they are). - - - parameter rate: a `BankersDecimal` representing the rate. - - returns: another `MoneyType` value. - */ - func convert(withRate rate: BankersDecimal) -> Other where Other.DecimalStorageType == BankersDecimal.DecimalStorageType { - return multiplying(by: Other(storage: rate.storage)) + public static func *=(lhs: inout Money, rhs: Money) { + let result: Money = lhs * rhs + lhs.decimal = result.decimal } -} -/** - - # Money - - `_Money` is a value type, conforming to `MoneyType`, which is generic over the currency type. - - To work in whatever the local currency is, use `Money`. It should not - be necessary to use `_Money` directly, instead, use a typealias, - such as `USD` or `GBP`. -*/ -public struct _Money: MoneyType { - - public typealias DecimalNumberBehavior = C - public typealias Currency = C - - /// Access the underlying decimal. - /// - returns: the `_Decimal` - public let decimal: _Decimal - - /// Access the underlying minor units - /// - returns: the `IntegerLiteralType` minor units - public var minorUnits: IntegerLiteralType { - return decimal.multiplying(byPowerOf10: Int16(Currency.scale)).integerValue + public static func /=(lhs: inout Money, rhs: Money) { + let result: Money = lhs / rhs + lhs.decimal = result.decimal } - /// Access the underlying decimal storage. - /// - returns: the `_Decimal.DecimalStorageType` - public var storage: _Decimal.DecimalStorageType { - return decimal.storage - } - /// Flag to indicate if the decimal number is less than zero - public var isNegative: Bool { - return decimal.isNegative - } - /// The negative of Self. - /// - returns: a `_Money` - public var negative: _Money { - return _Money(decimal.negative) - } + public private(set) var decimal: Decimal - /** - Initialize a new value using an underlying decimal. + public private(set) var currency: CurrencyProtocol - - parameter value: a `_Decimal` defaults to zero. - */ - public init(_ value: _Decimal = _Decimal()) { - decimal = value + public var magnitude: Decimal { + return decimal } - /** - Initialize the money with a integer representing minor units. - - parameter minorUnits: a `IntegerLiteralType` - */ - public init(minorUnits: IntegerLiteralType) { - decimal = _Decimal(integerLiteral: minorUnits).multiplying(byPowerOf10: Int16(Currency.scale * -1)) - } - - /** - Initialize a new value using the underlying decimal storage. - At the moment, this is a `NSDecimalNumber`. - - parameter storage: a `_Decimal.DecimalStorageType` - */ - public init(storage: _Decimal.DecimalStorageType) { - decimal = _Decimal(storage: storage) - } - /** - Initialize a new value using a `IntegerLiteralType` - - parameter integerLiteral: a `IntegerLiteralType` for the system, probably `Int`. - */ - public init(integerLiteral value: IntegerLiteralType) { - decimal = _Decimal(integerLiteral: value) + public init(decimal: Decimal = 0, currency: CurrencyProtocol = Currency.Local.sharedInstance) { + self.decimal = decimal + self.currency = currency } - /** - Initialize a new value using a `FloatLiteralType` - - - parameter floatLiteral: a `FloatLiteralType` for the system, probably `Double`. - */ - public init(floatLiteral value: FloatLiteralType) { - decimal = _Decimal(floatLiteral: value) - } - - /** - Subtract a matching `_Money` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - public func subtracting(_ other: _Money) -> _Money { - return _Money(decimal.subtracting(other.decimal)) + public init(decimal: Decimal) { + self.init(decimal: decimal, currency: Currency.Local.sharedInstance) } - /** - Add a matching `_Money` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - public func adding(_ other: _Money) -> _Money { - return _Money(decimal.adding(other.decimal)) + public init(integerLiteral value: Int) { + self.init(decimal: Decimal(integerLiteral: value)) } - /** - Multiply a matching `_Money` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - public func multiplying(by other: _Money) -> _Money { - return _Money(decimal.multiplying(by: other.decimal)) + public init(floatLiteral value: Double) { + self.init(decimal: Decimal(floatLiteral: value)) } - /** - Divide a matching `_Money` from the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - public func dividing(by other: _Money) -> _Money { - return _Money(decimal.dividing(by: other.decimal)) + public init?(exactly source: T) where T : BinaryInteger { + guard let decimal = Decimal(exactly: source) else { return nil } + self.init(decimal: decimal) } - /** - The remainder of dividing another `_Money` into the receiver. - - - parameter other: another instance of this type. - - returns: another instance of this type. - */ - public func remainder(_ other: _Money) -> _Money { - return _Money(decimal.remainder(other.decimal)) + public init(minorUnits: Int) { + self.currency = Currency.Local.sharedInstance + self.decimal = Decimal(minorUnits).multiplying(byPowersOf10: Int16(currency.scale * -1)) } -} - -// MARK: - Equality - -public func ==(lhs: _Money, rhs: _Money) -> Bool { - return lhs.decimal == rhs.decimal -} -// MARK: - Comparable -public func <(lhs: _Money, rhs: _Money) -> Bool { - return lhs.decimal < rhs.decimal } -// MARK: - CustomStringConvertible +// MARK: - Conformance -extension _Money: CustomStringConvertible { +extension Money: Equatable { - /** - Returns the result of the `formatted` function using - NSNumberFormatterStyle.CurrencyStyle. - */ - public var description: String { - return formatted(withStyle: C.defaultFormattingStyle) + public static func ==(lhs: Money, rhs: Money) -> Bool { + return lhs.decimal == rhs.decimal + && lhs.currency.code == rhs.currency.code + && lhs.currency.scale == rhs.currency.scale + && lhs.currency.symbol == rhs.currency.symbol } } -// MARK: - Value Coding +extension Money: Hashable { -extension _Money: ValueCoding { - public typealias Coder = _MoneyCoder + public var hashValue: Int { + return decimal.hashValue + } } -/** - Coding class to support `_Decimal` `ValueCoding` conformance. - */ -public final class _MoneyCoder: NSObject, NSCoding, CodingProtocol { - - public let value: _Money +extension Money: Comparable { - public required init(_ v: _Money) { - value = v - } + public static func <(lhs: Money, rhs: Money) -> Bool { - public init?(coder aDecoder: NSCoder) { - let decimal = _Decimal.decode(aDecoder.decodeObject(forKey: "decimal") as AnyObject?) - value = _Money(decimal!) - } + if lhs.currency.code != rhs.currency.code { + return lhs.currency.code < rhs.currency.code + } - public func encode(with aCoder: NSCoder) { - aCoder.encode(value.decimal.encoded, forKey: "decimal") + return lhs.decimal < rhs.decimal } } - -// MARK: - Consumption Types - -/// The current locale money -public typealias Money = _Money diff --git a/Sources/MoneyProtocol.swift b/Sources/MoneyProtocol.swift new file mode 100644 index 0000000..08e8f10 --- /dev/null +++ b/Sources/MoneyProtocol.swift @@ -0,0 +1,211 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import Foundation + +public protocol MoneyProtocol: SignedNumeric, ExpressibleByFloatLiteral, CustomStringConvertible { + + var decimal: Decimal { get } + + var currency: CurrencyProtocol { get } + + init(decimal: Decimal) + +} + +public extension MoneyProtocol { + + var amount: NSDecimalNumber { + return (decimal as NSDecimalNumber) + } + + var integerValue: Int { + return Int(amount.doubleValue) + } + + var floatValue: Double { + return amount.doubleValue + } + + var minorUnits: Int { + return Int((decimal.multiplying(byPowersOf10: Int16(currency.scale)) as NSDecimalNumber).doubleValue) + } + + var description: String { + return formatted(withStyle: .currency, forLocaleId: Locale.current.identifier) + } + + func formatted(withStyle style: NumberFormatter.Style = .currency, forLocaleId localeId: String = Locale.current.identifier) -> String { + return currency.numberFormatter(withStyle: style, forLocaleId: localeId).string(from: decimal as NSDecimalNumber) ?? decimal.description + } +} + +extension MoneyProtocol { + + public static func +(lhs: Self, rhs: Self) -> Self { + var (lhs, rhs) = (lhs.decimal, rhs.decimal) + var result = Decimal() + NSDecimalAdd(&result, &lhs, &rhs, .bankers) + return Self(decimal: result) + } + + public static func -(lhs: Self, rhs: Self) -> Self { + var (lhs, rhs) = (lhs.decimal, rhs.decimal) + var result = Decimal() + NSDecimalSubtract(&result, &lhs, &rhs, .bankers) + return Self(decimal: result) + } + + + public static func *(lhs: Self, rhs: Self) -> Self { + var (lhs, rhs) = (lhs.decimal, rhs.decimal) + var result = Decimal() + NSDecimalMultiply(&result, &lhs, &rhs, .bankers) + return Self(decimal: result) + } + + + public static func /(lhs: Self, rhs: Self) -> Self { + var (lhs, rhs) = (lhs.decimal, rhs.decimal) + var result = Decimal() + NSDecimalDivide(&result, &lhs, &rhs, .bankers) + return Self(decimal: result) + } +} + +extension MoneyProtocol where IntegerLiteralType == Decimal.IntegerLiteralType { + + public static func +(lhs: Self, rhs: Self.IntegerLiteralType) -> Self { + return Self(decimal: lhs.decimal + Decimal(integerLiteral: rhs)) + } + + public static func +(lhs: Self.IntegerLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(integerLiteral: lhs) + rhs.decimal) + } + + + public static func -(lhs: Self, rhs: Self.IntegerLiteralType) -> Self { + return Self(decimal: lhs.decimal - Decimal(integerLiteral: rhs)) + } + + public static func -(lhs: Self.IntegerLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(integerLiteral: lhs) - rhs.decimal) + } + + public static func *(lhs: Self, rhs: Self.IntegerLiteralType) -> Self { + return Self(decimal: lhs.decimal * Decimal(integerLiteral: rhs)) + } + + public static func *(lhs: Self.IntegerLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(integerLiteral: lhs) * rhs.decimal) + } + + public static func /(lhs: Self, rhs: Self.IntegerLiteralType) -> Self { + return Self(decimal: lhs.decimal / Decimal(integerLiteral: rhs)) + } + + public static func /(lhs: Self.IntegerLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(integerLiteral: lhs) / rhs.decimal) + } +} + +extension MoneyProtocol where FloatLiteralType == Decimal.FloatLiteralType { + + public static func +(lhs: Self, rhs: Self.FloatLiteralType) -> Self { + return Self(decimal: lhs.decimal + Decimal(floatLiteral: rhs)) + } + + public static func +(lhs: Self.FloatLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(floatLiteral: lhs) + rhs.decimal) + } + + public static func -(lhs: Self, rhs: Self.FloatLiteralType) -> Self { + return Self(decimal: lhs.decimal - Decimal(floatLiteral: rhs)) + } + + public static func -(lhs: Self.FloatLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(floatLiteral: lhs) - rhs.decimal) + } + + public static func *(lhs: Self, rhs: Self.FloatLiteralType) -> Self { + return Self(decimal: lhs.decimal * Decimal(floatLiteral: rhs)) + } + + public static func *(lhs: Self.FloatLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(floatLiteral: lhs) * rhs.decimal) + } + + public static func /(lhs: Self, rhs: Self.FloatLiteralType) -> Self { + return Self(decimal: lhs.decimal / Decimal(floatLiteral: rhs)) + } + + public static func /(lhs: Self.FloatLiteralType, rhs: Self) -> Self { + return Self(decimal: Decimal(floatLiteral: lhs) / rhs.decimal) + } +} + +public extension MoneyProtocol { + + func distance(to other: Self) -> Self { + return self - other + } + + func advanced(by other: Self) -> Self { + return self + other + } +} + +public extension MoneyProtocol { + + init(_ value: Int8) { + self.init(decimal: Decimal(value)) + } + + init(_ value: Int16) { + self.init(decimal: Decimal(value)) + } + + init(_ value: Int32) { + self.init(decimal: Decimal(value)) + } + + init(_ value: Int64) { + self.init(decimal: Decimal(value)) + } + + init(_ value: UInt8) { + self.init(decimal: Decimal(value)) + } + + init(_ value: UInt16) { + self.init(decimal: Decimal(value)) + } + + init(_ value: UInt32) { + self.init(decimal: Decimal(value)) + } + + init(_ value: UInt64) { + self.init(decimal: Decimal(value)) + } + + init(_ value: Int) { + self.init(decimal: Decimal(value)) + } + + init(_ value: UInt) { + self.init(decimal: Decimal(value)) + } + +} + + + + diff --git a/Sources/NSDecimalExtensions.swift b/Sources/NSDecimalExtensions.swift deleted file mode 100644 index 7122c7f..0000000 --- a/Sources/NSDecimalExtensions.swift +++ /dev/null @@ -1,155 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -import Foundation - -/** - # Decimal Extension - - This is an extension on Decimal to support `DecimalNumberType` and - `_Decimal`. - */ -internal extension Decimal { - - /** - Static function to get the `NSDecimal` representation of - zero. - - - returns: a `NSDecimal` of zero. - */ - static var zero: Decimal { - return NSDecimalNumber.zero.decimalValue - } - - /** - Static function to get the `NSDecimal` representation of - positive one. - - - returns: a `NSDecimal` of one. - */ - static var one: Decimal { - return NSDecimalNumber.one.decimalValue - } - - /** - Boolean flag to indicate if the receive is a negative - number. - - - returns: a `Bool` if the value is below zero. - */ - var isNegative: Bool { - return self < Decimal.zero - } - - internal init() { - self = Decimal.zero - } - - /** - Subtract a `NSDecimal` from the receiver. - - - parameter other: another `NSDecimal`. - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func subtracting(_ rhs: Decimal, withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - var (lhs, rhs) = (self, rhs) - var result = Decimal() - NSDecimalSubtract(&result, &lhs, &rhs, roundingMode) - return result - } - - /** - Add a `NSDecimal` to the receiver. - - - parameter other: another `NSDecimal`. - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func adding(_ rhs: Decimal, withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - var (lhs, rhs) = (self, rhs) - var result = Decimal() - NSDecimalAdd(&result, &lhs, &rhs, roundingMode) - return result - } - - /** - Multiply a `NSDecimal` with the receiver. - - - parameter other: another `NSDecimal`. - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func multiplying(by rhs: Decimal, withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - var (lhs, rhs) = (self, rhs) - var result = Decimal() - NSDecimalMultiply(&result, &lhs, &rhs, roundingMode) - return result - } - - /** - Divide the receiver by a matching `NSDecimal`. - - - parameter other: another `NSDecimal`. - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func dividing(by rhs: Decimal, withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - var (lhs, rhs) = (self, rhs) - var result = Decimal() - NSDecimalDivide(&result, &lhs, &rhs, roundingMode) - return result - } - - /** - Calculates the negative of the receiver. - - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func negate(withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - let zero = Decimal.zero - let negativeOne = zero.subtracting(Decimal.one, withRoundingMode: roundingMode) - let result = multiplying(by: negativeOne, withRoundingMode: roundingMode) - return result - } - - /** - The remainder of dividing another `NSDecimal` into the receiver. - - - parameter other: another `NSDecimal`. - - parameter roundingMode: the NSRoundingMode to use for the calculation. - - returns: a `NSDecimal`. - */ - func remainder(_ _rhs: Decimal, withRoundingMode roundingMode: NSDecimalNumber.RoundingMode) -> Decimal { - let lhs = NSDecimalNumber(decimal: self) - let rhs = NSDecimalNumber(decimal: _rhs) - let behaviors = NSDecimalNumberHandler(roundingMode: roundingMode, scale: 38, raiseOnExactness: false, raiseOnOverflow: false, raiseOnUnderflow: false, raiseOnDivideByZero: true) - let result = lhs.remainder(rhs, withBehavior: behaviors) - return result.decimalValue - } -} diff --git a/Sources/NSDecimalNumberExtensions.swift b/Sources/NSDecimalNumberExtensions.swift deleted file mode 100644 index e5b0dd3..0000000 --- a/Sources/NSDecimalNumberExtensions.swift +++ /dev/null @@ -1,91 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - - -import Foundation - -// MARK: - Equality - -public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { - return lhs.isEqual(to: rhs) -} - -// MARK: - Comparable - -extension NSDecimalNumber: Comparable { } - -public func <(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { - return lhs.compare(rhs) == .orderedAscending -} - -/** - # NSDecimalNumber Extension - This is an extension on NSDecimalNumber to support `DecimalNumberType` and - `Decimal`. - - Note that NSDecimalNumber cannot conform to `DecimalNumberType` directly - because it is a framework class which cannot be made final, and the protocol - has functions which return Self. - */ -internal extension NSDecimalNumber { - - var isNegative: Bool { - return self < NSDecimalNumber.zero - } - - /** - Calculates the negative of the receiver. - - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: a `NSDecimalNumber`. - */ - func negate(withBehavior behavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber { - let negativeOne = NSDecimalNumber(mantissa: 1, exponent: 0, isNegative: true) - let result = multiplying(by: negativeOne, withBehavior: behavior) - return result - } - - /** - The remainder of dividing another `NSDecimalNumber` into the receiver. - - - parameter other: another `NSDecimalNumber`. - - parameter behaviors: an optional NSDecimalNumberBehaviors? - - returns: a `NSDecimalNumber`. - */ - func remainder(_ other: NSDecimalNumber, withBehavior behavior: NSDecimalNumberBehaviors?) -> NSDecimalNumber { - let a: Int = (isNegative ? 0 : 1) - let b: Int = (other.isNegative ? 0 : 1) - let trueOrFalse = (a ^ b) > 0 ? true : false - let roundingMode: NSDecimalNumber.RoundingMode = trueOrFalse ? NSDecimalNumber.RoundingMode.up : NSDecimalNumber.RoundingMode.down - let roundingBehaviors = NSDecimalNumberHandler(roundingMode: roundingMode, scale: 0, raiseOnExactness: false, raiseOnOverflow: false, raiseOnUnderflow: false, raiseOnDivideByZero: false) - let quotient = dividing(by: other, withBehavior: roundingBehaviors) - let toSubtract = quotient.multiplying(by: other, withBehavior: behavior) - let result = subtracting(toSubtract, withBehavior: behavior) - return result - } -} - - diff --git a/Sources/NSLocale+Extensions.swift b/Sources/NSLocale+Extensions.swift new file mode 100644 index 0000000..cf7038b --- /dev/null +++ b/Sources/NSLocale+Extensions.swift @@ -0,0 +1,45 @@ +// +// Money +// File created on 20/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import Foundation + +/** + Convenience currency related properties on NSLocale + */ +internal extension NSLocale { + + /// - returns: a String? for the currency code. + var mny_currencyCode: String? { + if #available(iOS 10.0, iOSApplicationExtension 10.0, watchOS 3.0, watchOSApplicationExtension 3.0, tvOS 10.0, tvOSApplicationExtension 10.0, OSX 10.12, OSXApplicationExtension 10.12, *) { + return currencyCode + } else { + return object(forKey: NSLocale.Key.currencyCode) as? String + } + } + + /// - returns: a String? for the currency symbol. + var mny_currencySymbol: String? { + if #available(iOS 10.0, iOSApplicationExtension 10.0, watchOS 3.0, watchOSApplicationExtension 3.0, tvOS 10.0, tvOSApplicationExtension 10.0, OSX 10.12, OSXApplicationExtension 10.12, *) { + return currencySymbol + } else { + return object(forKey: NSLocale.Key.currencySymbol) as? String + } + } + + /// - returns: a String? for the currency grouping separator. + var mny_currencyGroupingSeparator: String? { + return object(forKey: NSLocale.Key.groupingSeparator) as? String + } + + /// - returns: a String? for the currency decimal separator. + var mny_currencyDecimalSeparator: String? { + return object(forKey: NSLocale.Key.decimalSeparator) as? String + } +} diff --git a/Supporting Files/Carthage.xcconfig b/Supporting Files/Carthage.xcconfig deleted file mode 100644 index 76e8367..0000000 --- a/Supporting Files/Carthage.xcconfig +++ /dev/null @@ -1,10 +0,0 @@ -// -// FeatureKit -// -// Copyright © 2016 FeatureKit. All rights reserved. -// - -FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(SRCROOT)/Carthage/Build/Mac/ $(inherited) -FRAMEWORK_SEARCH_PATHS[sdk=iphone*] = $(SRCROOT)/Carthage/Build/iOS/ $(inherited) -FRAMEWORK_SEARCH_PATHS[sdk=watch*] = $(SRCROOT)/Carthage/Build/watchOS/ $(inherited) -FRAMEWORK_SEARCH_PATHS[sdk=appletv*] = $(SRCROOT)/Carthage/Build/tvOS/ $(inherited) diff --git a/Supporting Files/Generate.swift b/Supporting Files/Generate.swift index b94c36e..a5a35de 100755 --- a/Supporting Files/Generate.swift +++ b/Supporting Files/Generate.swift @@ -10,536 +10,159 @@ import Foundation -typealias Writer = (String) -> Void -typealias Generator = (Writer) -> Void - -let enUS = NSLocale(localeIdentifier: "en_US") - -protocol TypeGenerator { - static var typeName: String { get } - var displayName: String { get } -} - -extension TypeGenerator { - - var name: String { - return displayName.capitalized(with: Locale(identifier: "en_US")) - .replacingOccurrences(of: " ", with: "") - .replacingOccurrences(of: " ", with: "") - .replacingOccurrences(of: "-", with: "") - .replacingOccurrences(of: "ʼ", with: "") - .replacingOccurrences(of: ".", with: "") - .replacingOccurrences(of: "&", with: "") - .replacingOccurrences(of: "(", with: "") - .replacingOccurrences(of: ")", with: "") - .replacingOccurrences(of: "’", with: "") - } - - var caseNameValue: String { - return ".\(name)" - } - - var protocolName: String { - return "\(name)\(Self.typeName)Type" - } -} - -/// MARK: - Currency Info - -func createMoneyType(forCurrencyCode code: String) -> String { - return "_Money" -} - -func createExtension(for typename: String, withWriter writer: Writer, content: Generator) { - writer("extension \(typename) {") - content(writer) - writer("}") -} - -func createFrontMatter(withWriter writer: Writer) { - writer("// ") - writer("// Money, https://github.com/danthorpe/Money") - writer("// Created by Dan Thorpe, @danthorpe") - writer("// ") - writer("// The MIT License (MIT)") - writer("// ") - writer("// Copyright (c) 2015 Daniel Thorpe") - writer("// ") - writer("// Permission is hereby granted, free of charge, to any person obtaining a copy") - writer("// of this software and associated documentation files (the \"Software\"), to deal") - writer("// in the Software without restriction, including without limitation the rights") - writer("// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell") - writer("// copies of the Software, and to permit persons to whom the Software is") - writer("// furnished to do so, subject to the following conditions:") - writer("// ") - writer("// The above copyright notice and this permission notice shall be included in all") - writer("// copies or substantial portions of the Software.") - writer("// ") - writer("// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR") - writer("// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,") - writer("// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE") - writer("// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER") - writer("// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,") - writer("// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE") - writer("// SOFTWARE.") - writer("// ") - writer("// Autogenerated from build scripts, do not manually edit this file.") - writer("") -} - -func createCurrencyTypes(line: Writer) { - for code in Locale.isoCurrencyCodes { - line("") - line(" /// Currency \(code)") - line(" public final class \(code): Currency.Base, ISOCurrencyType {") - line(" /// - returns: lazy shared instance for Currency.\(code)") - line(" public static var sharedInstance = \(code)(code: \"\(code)\")") - line(" }") - } +enum Source { + case source, tests } -func createMoneyTypes(withWriter writer: Writer) { - writer("") +protocol WriterProtocol { - for code in Locale.isoCurrencyCodes { - writer("/// \(code) Money") - let name = createMoneyType(forCurrencyCode: code) - writer("public typealias \(code) = \(name)") - } + func write(_ str: String) } -/// MARK: - Locale Info +typealias ContentWriter = (WriterProtocol) -> Void -struct Country: Comparable, TypeGenerator, CustomStringConvertible { - static let typeName = "Country" - let id: String - let displayName: String - var langaugeIds = Set() +class Writer: WriterProtocol { - var description: String { - return "\(self.id): \(displayName) -> \(langaugeIds)" - } + let stream: OutputStream - init?(id: String) { - self.id = id - guard let countryDisplayName = enUS.displayName(forKey: NSLocale.Key.countryCode, value: id) else { - return nil + init(destination: String) { + guard let outputStream = OutputStream(toFileAtPath: destination, append: false) else { + fatalError("Unable to create output stream at path: \(destination)") } - displayName = countryDisplayName - } -} - -struct Language: Comparable, TypeGenerator, CustomStringConvertible { - static let typeName = "Language" - - let id: String - let displayName: String - var countryIds = Set() - - var description: String { - return "\(id): \(displayName) -> \(countryIds)" + stream = outputStream + stream.open() + createFrontMatter() } - var languageSpeakingCountryEnumName: String { - return "\(name)Speaking\(Country.typeName)" + deinit { + stream.close() } - init?(id: String) { - self.id = id - guard let languageDisplayName = enUS.displayName(forKey: NSLocale.Key.languageCode, value: id) else { - return nil - } - displayName = languageDisplayName - } -} - -func ==(lhs: Country, rhs: Country) -> Bool { - return lhs.id == rhs.id -} - -func <(lhs: Country, rhs: Country) -> Bool { - return lhs.name < rhs.name -} - -func ==(lhs: Language, rhs: Language) -> Bool { - return lhs.id == rhs.id -} - -func <(lhs: Language, rhs: Language) -> Bool { - return lhs.name < rhs.name -} - -typealias LanguagesById = Dictionary -typealias CountriesById = Dictionary - -struct LocaleInfo { - - let languagesById: LanguagesById - let countriesById: CountriesById - let languages: [Language] - let countries: [Country] - let languagesWithLessThanTwoCountries: [Language] - let languagesWithMoreThanOneCountry: [Language] - - init() { - let localeIDs = NSLocale.availableLocaleIdentifiers - var _countriesById = CountriesById() - var _languagesById = LanguagesById() - - for id in localeIDs { - let locale = NSLocale(localeIdentifier: id) - let countryId = locale.object(forKey: NSLocale.Key.countryCode) as? String - let country: Country? = countryId.flatMap { _countriesById[$0] ?? Country(id: $0) } - let languageId = locale.object(forKey: NSLocale.Key.languageCode) as? String - let language: Language? = languageId.flatMap { _languagesById[$0] ?? Language(id: $0) } - - if let countryId = countryId, var language = language { - language.countryIds.insert(countryId) - _languagesById.updateValue(language, forKey: language.id) - } - - if let languageId = languageId, var country = country { - country.langaugeIds.insert(languageId) - _countriesById.updateValue(country, forKey: country.id) - } + func write(_ str: String) { + guard let data = str.data(using: String.Encoding.utf8) else { + fatalError("Unable to encode str: \(str)") } - - self.languagesById = _languagesById - self.countriesById = _countriesById - - countries = ([Country])(countriesById.values).sorted { $0.langaugeIds.count > $1.langaugeIds.count } - languages = ([Language])(languagesById.values).sorted { $0.countryIds.count > $1.countryIds.count } - - languagesWithLessThanTwoCountries = languages.filter({ $0.countryIds.count < 2 }).sorted() - languagesWithMoreThanOneCountry = languages.filter({ $0.countryIds.count > 1 }).sorted() + let _ = data.withUnsafeBytes { stream.write($0, maxLength: data.count) } } } -let info = LocaleInfo() - -func createLanguageSpeakingCountry(withWriter writer: Writer, language: Language) { - let name = language.languageSpeakingCountryEnumName +extension WriterProtocol { - writer("") - writer("/**") - writer(" An enum of countries which speak \(language.displayName).") - writer("*/") - writer("public enum \(name): CountryType {") - - let _countries = language.countryIds.sorted().flatMap { info.countriesById[$0] } - - // Write the cases - writer("") - for country in _countries { - writer(" /// \(country.displayName) is a country which speaks \(language.displayName).") - writer(" case \(country.name)") + func line(_ str: String) { + write("\(str)\n") } - - // Write a static constant for all - let caseNames = _countries.map { $0.caseNameValue } - let joinedCaseNames = caseNames.joined(separator: ", ") - writer("") - writer(" /// - returns: an Array of all the countries which speak \(language.displayName)") - writer(" public static let all: [\(name)] = [ \(joinedCaseNames) ]") - - writer("") - writer(" /// - returns: the country identifier of a specific \(language.displayName) speaking country.") - writer(" public var countryIdentifier: String {") - writer(" switch self {") - - for country in _countries { - writer(" case .\(country.name):") - writer(" return \"\(country.id)\"") + func createFrontMatter() { + line("//") + line("// Money") + line("//") + line("// Copyright (c) 2015-2017 Daniel Thorpe") + line("//") + line("// Money is licensed under the MIT License. Read the full license at") + line("// https://github.com/danthorpe/Money/blob/master/LICENSE") + line("//") + line("// Autogenerated from build scripts, do not manually edit this file.") + line("//") + line("") } - - writer(" }") // End of switch - writer(" }") // End of var - - writer("}") // End of enum } -func createLanguageSpeakingCountries(withWriter writer: Writer) { - writer("") - writer("// MARK: - Country Types") - for language in info.languagesWithMoreThanOneCountry { - createLanguageSpeakingCountry(withWriter: writer, language: language) - } +// MARK: - Types + +protocol TypeCreator { + static var typeName: String { get } + var displayName: String { get } } -func createLocale(withWriter writer: Writer) { - writer("") - writer("// MARK: - Locale") - - do { - writer("") - writer("/**") - writer("") - writer("Locale is an enum for type safe representation ") - writer("of locale identifiers. Its cases are languages ") - writer("in US English. For languages which are spoken ") - writer("in more than one country, an associated value ") - writer("of the country should be provided. For example ") - writer("") - writer("```swift") - writer("let locale: MNYLocale = .French(.France)") - writer("```") - writer("*/") - writer("public enum MNYLocale {") - - for language in info.languages.sorted() { - writer("") - if language.countryIds.count > 1 { - writer(" /**") - writer(" ### \(language.displayName)") - writer(" - requires: \(language.languageSpeakingCountryEnumName)") - writer(" */") - writer(" case \(language.name)(\(language.languageSpeakingCountryEnumName))") - } - else { - writer(" /// ### \(language.displayName)") - writer(" case \(language.name)") - } - } +extension TypeCreator { - writer("}") // End of enum + var capitalizedName: String { + return displayName.capitalized(with: Locale(identifier: "en_US")) + .replacingOccurrences(of: " ", with: "") + .replacingOccurrences(of: " ", with: "") + .replacingOccurrences(of: "-", with: "") + .replacingOccurrences(of: "ʼ", with: "") + .replacingOccurrences(of: ".", with: "") + .replacingOccurrences(of: "&", with: "") + .replacingOccurrences(of: "(", with: "") + .replacingOccurrences(of: ")", with: "") + .replacingOccurrences(of: "’", with: "") } - // Add extension for LanguageType protocol - do { - writer("") - writer("/**") - writer(" Locale conforms to LanguageType.") - writer("*/") - writer("extension MNYLocale: LanguageType {") - writer("") - writer(" /// - returns: the lanauge identifier as a String.") - writer(" public var languageIdentifier: String {") - writer(" switch self {") - - for language in info.languages.sorted() { - if language.countryIds.count > 1 { - writer(" case .\(language.name)(_):") - writer(" return \"\(language.id)\"") - } - else { - writer(" case .\(language.name):") - writer(" return \"\(language.id)\"") - } - } - - writer(" }") // End of switch - writer(" }") // End of var - writer("}") // End of extension + var caseName: String { + return capitalizedName } - // Add extension for CountryType protocol - do { - writer("") - writer("/**") - writer(" Locale conforms to CountryType.") - writer("*/") - writer("extension MNYLocale: CountryType {") - writer("") - writer(" /// - returns: the country identifier as a String.") - writer(" public var countryIdentifier: String {") - writer(" switch self {") - - let caseNames = info.languagesWithLessThanTwoCountries.map { $0.caseNameValue } - let joinedCaseNames = caseNames.joined(separator: ", ") - writer(" case \(joinedCaseNames):") - writer(" return \"\"") - - for language in info.languagesWithMoreThanOneCountry { - writer(" case .\(language.name)(let country):") - writer(" return country.countryIdentifier") - } - - writer(" }") // End of switch - writer(" }") // End of var - writer("}") // End of extension + var caseNameValue: String { + return ".\(caseName)" } - // Add extension for LocaleType protocol - do { - writer("") - writer("extension MNYLocale: LocaleType {") - writer(" // Uses default implementation") - writer("}") // End of extension + var protocolName: String { + return "\(capitalizedName)\(Self.typeName)Protocol" } } -func createLocaleTypes(withWriter writer: Writer) { - - // Create the (Language)SpeakingCountry enum types - createLanguageSpeakingCountries(withWriter: writer) +// MARK: - Writer Functions - // Create the Locale enum - createLocale(withWriter: writer) +func makeMoneyType(for code: String) -> String { + return "ISOMoney" } -// MARK: - Unit Tests - -func createUnitTestImports(withWriter writer: Writer) { - writer("import XCTest") - writer("@testable import Money") -} - -func createXCTestCaseNamed(withWriter writer: Writer, className: String, content: Generator) { - writer("") - writer("class \(className)AutogeneratedTests: XCTestCase {") +func makeExtension(for typename: String, with writer: WriterProtocol, content: ContentWriter) { + writer.line("extension \(typename) {") content(writer) - writer("}") -} - -func createTestForCountryIdentifierFromCountryCaseName(withWriter writer: Writer, country: Country) { - writer("") - writer(" func test__country_identifier_for_\(country.name)() {") - writer(" country = .\(country.name)") - writer(" XCTAssertEqual(country.countryIdentifier, \"\(country.id)\")") - writer(" }") -} - -func createUnitTestsForLanguageSpeakingCountry(withWriter writer: Writer, language: Language) { - let name = language.languageSpeakingCountryEnumName - createXCTestCaseNamed(withWriter: writer, className: name) { line in - writer("") - writer(" var country: \(name)!") - for country in language.countryIds.flatMap({ info.countriesById[$0] }) { - createTestForCountryIdentifierFromCountryCaseName(withWriter: writer, country: country) - } - } + writer.line("}") } -func createUnitTestsForLanguageSpeakingCountries(withWriter writer: Writer) { - writer("") - writer("// MARK: - Country Types Tests") - for language in info.languagesWithMoreThanOneCountry { - createUnitTestsForLanguageSpeakingCountry(withWriter: writer, language: language) - } -} - -func createTestForLanguageIdentifier(withWriter writer: Writer, language: Language, country: Country? = nil) { - writer("") - if let country = country { - writer(" func test__language_identifier_for_\(language.name)_\(country.name)() {") - writer(" locale = .\(language.name)(\(country.caseNameValue))") - writer(" XCTAssertEqual(locale.languageIdentifier, \"\(language.id)\")") - writer(" XCTAssertEqual(locale.localeIdentifier, \"\(language.id)_\(country.id)\")") - writer(" }") - } - else { - writer(" func test__language_identifier_for_\(language.name)() {") - writer(" locale = .\(language.name)") - writer(" XCTAssertEqual(locale.languageIdentifier, \"\(language.id)\")") - writer(" XCTAssertEqual(locale.localeIdentifier, \"\(language.id)\")") - writer(" }") - } -} +// MARK: - Currencies & Monies -func createUnitTestsForLocaleWithLanguage(withWriter writer: Writer, language: Language) { - if language.countryIds.count < 2 { - createTestForLanguageIdentifier(withWriter: writer, language: language) - } - else { - for country in language.countryIds.flatMap({ info.countriesById[$0] }) { - createTestForLanguageIdentifier(withWriter: writer, language: language, country: country) - } +func makeCurrencyTypes(with writer: WriterProtocol) { + for code in Locale.isoCurrencyCodes { + writer.line("") + writer.line(" /// Currency \(code)") + writer.line(" public final class \(code): BaseCurrency, ISOCurrencyProtocol {") + writer.line(" /// - returns: shared instance for Currency.\(code)") + writer.line(" public static let shared = \(code)(code: \"\(code)\")") + writer.line(" }") } } -func createUnitTestsForLocale(withWriter writer: Writer) { - writer("") - writer("// MARK: - Locale Tests") - - for language in info.languagesWithMoreThanOneCountry { - - createXCTestCaseNamed(withWriter: writer, className: "MNYLocale\(language.name)Language") { writer in - writer("") - writer(" var locale: MNYLocale!") - - createUnitTestsForLocaleWithLanguage(withWriter: writer, language: language) - } - } - - createXCTestCaseNamed(withWriter: writer, className: "MNYLocale") { line in - writer("") - writer(" var locale: MNYLocale!") - - for language in info.languagesWithLessThanTwoCountries { - createUnitTestsForLocaleWithLanguage(withWriter: writer, language: language) - } +func makeMoneyTypes(with writer: WriterProtocol) { + writer.line("") + for code in Locale.isoCurrencyCodes { + writer.line("") + writer.line("/// \(code) Money") + let name = makeMoneyType(for: code) + writer.line("public typealias \(code) = \(name)") } } -// MARK: - Generators - -func generateSourceCode(to outputPath: String) { - - guard let outputStream = OutputStream(toFileAtPath: outputPath, append: false) else { - fatalError("Unable to create output stream at path: \(outputPath)") - } - - defer { - outputStream.close() - } - - let write: Writer = { str in - guard let data = str.data(using: String.Encoding.utf8) else { - fatalError("Unable to encode str: \(str)") - } - let _ = data.withUnsafeBytes { outputStream.write($0, maxLength: data.count) } - } - let writeLine: Writer = { write("\($0)\n") } - outputStream.open() - createFrontMatter(withWriter: writeLine) - createExtension(for: "Currency", withWriter: writeLine, content: createCurrencyTypes) - write("\n") - createMoneyTypes(withWriter: writeLine) - write("\n") - createLocaleTypes(withWriter: writeLine) -} -func generateUnitTests(to outputPath: String) { +func generate(_ source: Source, to path: String) { - guard let outputStream = OutputStream(toFileAtPath: outputPath, append: false) else { - fatalError("Unable to create output stream at path: \(outputPath)") - } - - defer { - outputStream.close() - } + let writer = Writer(destination: path) - let write: Writer = { str in - guard let data = str.data(using: String.Encoding.utf8) else { - fatalError("Unable to encode str: \(str)") - } - let _ = data.withUnsafeBytes { outputStream.write($0, maxLength: data.count) } + switch source { + case .source: + writer.line("// MARK: - Currencies") + writer.line("") + makeExtension(for: "Currency", with: writer, content: makeCurrencyTypes) + writer.line("") + writer.line("// MARK: - Money") + writer.line("") + makeMoneyTypes(with: writer) + case .tests: + break } - - let writeLine: Writer = { write("\($0)\n") } - - outputStream.open() - - createFrontMatter(withWriter: writeLine) - - createUnitTestImports(withWriter: writeLine) - - createUnitTestsForLanguageSpeakingCountries(withWriter: writeLine) - - createUnitTestsForLocale(withWriter: writeLine) } // MARK: - Main() let process = Process() let pathToSourceCodeFile = "\(process.currentDirectoryPath)/Sources/Autogenerated.swift" -generateSourceCode(to: pathToSourceCodeFile) - -let pathToUnitTestsFile = "\(process.currentDirectoryPath)/Tests/AutogeneratedTests.swift" -generateUnitTests(to: pathToUnitTestsFile) +generate(.source, to: pathToSourceCodeFile) diff --git a/Supporting Files/Money.xcconfig b/Supporting Files/Money.xcconfig index a31ec10..325bf8a 100644 --- a/Supporting Files/Money.xcconfig +++ b/Supporting Files/Money.xcconfig @@ -1,7 +1,10 @@ // -// Money +// Money // -// Copyright © 2016 Money. All rights reserved. +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE // #include "Version.xcconfig" @@ -23,7 +26,7 @@ APPLICATION_EXTENSION_API_ONLY_framework = YES APPLICATION_EXTENSION_API_ONLY_xctest = NO APPLICATION_EXTENSION_API_ONLY = $(APPLICATION_EXTENSION_API_ONLY_$(WRAPPER_EXTENSION)) -SWIFT_VERSION = 3.0 +SWIFT_VERSION = 3.2 // Build Settings SUPPORTED_PLATFORMS = macosx iphoneos appletvos watchos appletvsimulator iphonesimulator watchsimulator @@ -36,7 +39,7 @@ CODE_SIGN_IDENTITY = - // Deployment DEFINES_MODULE = YES -MACOSX_DEPLOYMENT_TARGET = 10.11 +MACOSX_DEPLOYMENT_TARGET = 10.12 IPHONEOS_DEPLOYMENT_TARGET = 8.0 TVOS_DEPLOYMENT_TARGET = 9.2 WATCHOS_DEPLOYMENT_TARGET = 2.2 @@ -46,5 +49,4 @@ LD_RUNPATH_SEARCH_PATHS_xctest = @loader_path/Frameworks @executable_path/Framew LD_RUNPATH_SEARCH_PATHS = $(LD_RUNPATH_SEARCH_PATHS_$(WRAPPER_EXTENSION)) #include "Warnings.xcconfig" -#include "Carthage.xcconfig" diff --git a/Supporting Files/Version.xcconfig b/Supporting Files/Version.xcconfig index 997e8ea..c748d73 100644 --- a/Supporting Files/Version.xcconfig +++ b/Supporting Files/Version.xcconfig @@ -1 +1,10 @@ -MONEY_VERSION = 2.0.1 +// +// Money +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +MONEY_VERSION = 3.0.0 diff --git a/Supporting Files/Warnings.xcconfig b/Supporting Files/Warnings.xcconfig index 731fc7d..fe716e0 100644 --- a/Supporting Files/Warnings.xcconfig +++ b/Supporting Files/Warnings.xcconfig @@ -1,7 +1,10 @@ // -// Money +// Money // -// Copyright © 2016 Money. All rights reserved. +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE // CLANG_WARN_DOCUMENTATION_COMMENTS = YES diff --git a/Tests/AdditionTests.swift b/Tests/AdditionTests.swift new file mode 100644 index 0000000..c469693 --- /dev/null +++ b/Tests/AdditionTests.swift @@ -0,0 +1,55 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__money_addition() { + money = 10 + let result = money + Money(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 20) + } + + func test__money_addition_by_integer_literals() { + money = 10 + let result = 3 + money + 2 + XCTAssertEqual(result, 15) + } + + func test__money_addition_by_float_literals() { + money = 10 + let result = 3.5 + money + 2.5 + XCTAssertEqual(result, 16) + } +} + +extension MoneyTestCase { + + func test__iso_addition() { + gbp = 10 + let result = gbp + GBP(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 20) + } + + func test__iso_addition_by_integer_literals() { + gbp = 10 + let result = 3 + gbp + 2 + XCTAssertEqual(result, 15) + } + + func test__iso_addition_by_float_literals() { + gbp = 10 + let result = 3.5 + gbp + 2.5 + XCTAssertEqual(result, 16) + } +} diff --git a/Tests/ApplePayTests.swift b/Tests/ApplePayTests.swift deleted file mode 100644 index 5151905..0000000 --- a/Tests/ApplePayTests.swift +++ /dev/null @@ -1,139 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#if os(iOS) - -import XCTest -import PassKit -@testable import Money - -class ApplePayTests: XCTestCase { - - var item: PaymentSummaryItem! - var items: Set> = [] - - override func setUp() { - super.setUp() - item = PaymentSummaryItem(label: "iPad Pro, 32GB with WiFi", cost: 679, type: .final) - items.insert(item) - } -} - -class PaymentSummaryItemTests: ApplePayTests { - - func test__init__sets_money() { - XCTAssertEqual(item.cost, 679) - } - - func test__init__sets_label() { - XCTAssertEqual(item.label, "iPad Pro, 32GB with WiFi") - } - - func test__init__sets_type() { - XCTAssertEqual(item.type, PaymentSummaryItemType.final) - } - - func test__set_new_money__sets_money() { - item = item.set(cost: 799) - XCTAssertEqual(item.cost, 799) - XCTAssertEqual(item.label, "iPad Pro, 32GB with WiFi") - XCTAssertEqual(item.type, PaymentSummaryItemType.final) - } - - func test__set_new_label__sets_label() { - item = item.set(label: "iPad Pro, 128GB with WiFi") - XCTAssertEqual(item.cost, 679) - XCTAssertEqual(item.label, "iPad Pro, 128GB with WiFi") - XCTAssertEqual(item.type, PaymentSummaryItemType.final) - } - - func test__set_new_type__sets_type() { - item = item.set(type: .pending) - XCTAssertEqual(item.cost, 0) - XCTAssertEqual(item.label, "iPad Pro, 32GB with WiFi") - XCTAssertEqual(item.type, PaymentSummaryItemType.pending) - } - - func test__equality() { - XCTAssertEqual(item, PaymentSummaryItem(label: "iPad Pro, 32GB with WiFi", cost: 679, type: .final)) - XCTAssertNotEqual(item, PaymentSummaryItem(label: "iPad Pro, 128GB with WiFi", cost: 799, type: .final)) - } -} - -class PaymentSummaryItemCodingTests: ApplePayTests { - - func archiveEncoded() -> Data { - return NSKeyedArchiver.archivedData(withRootObject: item.encoded) - } - - func unarchive(_ archive: Data) -> PaymentSummaryItem? { - return PaymentSummaryItem.decode(NSKeyedUnarchiver.unarchiveObject(with: archive) as AnyObject?) - } - - func test__encode_decode() { - XCTAssertEqual(unarchive(archiveEncoded()), item) - } -} - -class PKPaymentSummaryItemTypeTests: ApplePayTests { - - func test__init__final() { - let type = PKPaymentSummaryItemType(paymentSummaryItemType: .final) - XCTAssertEqual(type, PKPaymentSummaryItemType.final) - } - - func test__init__pending() { - let type = PKPaymentSummaryItemType(paymentSummaryItemType: .pending) - XCTAssertEqual(type, PKPaymentSummaryItemType.pending) - } -} - -class PKPaymentSummaryItemTests: ApplePayTests { - - func test__init__with_item() { - let summaryItem = PKPaymentSummaryItem(paymentSummaryItem: item) - XCTAssertEqual(summaryItem.amount, NSDecimalNumber(value: 679)) - XCTAssertEqual(summaryItem.label, "iPad Pro, 32GB with WiFi") - XCTAssertEqual(summaryItem.type, PKPaymentSummaryItemType.final) - } -} - -class PKPaymentRequestTests: ApplePayTests { - - func test__init__with_items() { - items.insert(PaymentSummaryItem(label: "iPad Pro, 128GB with WiFi", cost: 799, type: .final)) - items.insert(PaymentSummaryItem(label: "iPad Pro, 128GB with WiFi + Cellular", cost: 899, type: .final)) - let request = PKPaymentRequest(items: Array(items), sellerName: "Acme. Inc") - - XCTAssertEqual(request.currencyCode, GBP.Currency.code) - XCTAssertEqual(request.paymentSummaryItems.count, 4) - XCTAssertEqual(request.paymentSummaryItems.last!.label, "Acme. Inc") - XCTAssertEqual(request.paymentSummaryItems.last!.amount, items.map { $0.cost }.reduce(0, +).amount) - } -} - -#endif - diff --git a/Tests/AutogeneratedTests.swift b/Tests/AutogeneratedTests.swift deleted file mode 100644 index b79ceda..0000000 --- a/Tests/AutogeneratedTests.swift +++ /dev/null @@ -1,5441 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// Autogenerated from build scripts, do not manually edit this file. - -import XCTest -@testable import Money - -// MARK: - Country Types Tests - -class AfrikaansSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: AfrikaansSpeakingCountry! - - func test__country_identifier_for_Namibia() { - country = .Namibia - XCTAssertEqual(country.countryIdentifier, "NA") - } - - func test__country_identifier_for_SouthAfrica() { - country = .SouthAfrica - XCTAssertEqual(country.countryIdentifier, "ZA") - } -} - -class AlbanianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: AlbanianSpeakingCountry! - - func test__country_identifier_for_Macedonia() { - country = .Macedonia - XCTAssertEqual(country.countryIdentifier, "MK") - } - - func test__country_identifier_for_Albania() { - country = .Albania - XCTAssertEqual(country.countryIdentifier, "AL") - } - - func test__country_identifier_for_Kosovo() { - country = .Kosovo - XCTAssertEqual(country.countryIdentifier, "XK") - } -} - -class ArabicSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: ArabicSpeakingCountry! - - func test__country_identifier_for_Somalia() { - country = .Somalia - XCTAssertEqual(country.countryIdentifier, "SO") - } - - func test__country_identifier_for_Iraq() { - country = .Iraq - XCTAssertEqual(country.countryIdentifier, "IQ") - } - - func test__country_identifier_for_Kuwait() { - country = .Kuwait - XCTAssertEqual(country.countryIdentifier, "KW") - } - - func test__country_identifier_for_Chad() { - country = .Chad - XCTAssertEqual(country.countryIdentifier, "TD") - } - - func test__country_identifier_for_Libya() { - country = .Libya - XCTAssertEqual(country.countryIdentifier, "LY") - } - - func test__country_identifier_for_Egypt() { - country = .Egypt - XCTAssertEqual(country.countryIdentifier, "EG") - } - - func test__country_identifier_for_WesternSahara() { - country = .WesternSahara - XCTAssertEqual(country.countryIdentifier, "EH") - } - - func test__country_identifier_for_SaudiArabia() { - country = .SaudiArabia - XCTAssertEqual(country.countryIdentifier, "SA") - } - - func test__country_identifier_for_Mauritania() { - country = .Mauritania - XCTAssertEqual(country.countryIdentifier, "MR") - } - - func test__country_identifier_for_Djibouti() { - country = .Djibouti - XCTAssertEqual(country.countryIdentifier, "DJ") - } - - func test__country_identifier_for_Eritrea() { - country = .Eritrea - XCTAssertEqual(country.countryIdentifier, "ER") - } - - func test__country_identifier_for_Lebanon() { - country = .Lebanon - XCTAssertEqual(country.countryIdentifier, "LB") - } - - func test__country_identifier_for_Oman() { - country = .Oman - XCTAssertEqual(country.countryIdentifier, "OM") - } - - func test__country_identifier_for_PalestinianTerritories() { - country = .PalestinianTerritories - XCTAssertEqual(country.countryIdentifier, "PS") - } - - func test__country_identifier_for_Sudan() { - country = .Sudan - XCTAssertEqual(country.countryIdentifier, "SD") - } - - func test__country_identifier_for_SouthSudan() { - country = .SouthSudan - XCTAssertEqual(country.countryIdentifier, "SS") - } - - func test__country_identifier_for_Algeria() { - country = .Algeria - XCTAssertEqual(country.countryIdentifier, "DZ") - } - - func test__country_identifier_for_Morocco() { - country = .Morocco - XCTAssertEqual(country.countryIdentifier, "MA") - } - - func test__country_identifier_for_Bahrain() { - country = .Bahrain - XCTAssertEqual(country.countryIdentifier, "BH") - } - - func test__country_identifier_for_UnitedArabEmirates() { - country = .UnitedArabEmirates - XCTAssertEqual(country.countryIdentifier, "AE") - } - - func test__country_identifier_for_Qatar() { - country = .Qatar - XCTAssertEqual(country.countryIdentifier, "QA") - } - - func test__country_identifier_for_Comoros() { - country = .Comoros - XCTAssertEqual(country.countryIdentifier, "KM") - } - - func test__country_identifier_for_Syria() { - country = .Syria - XCTAssertEqual(country.countryIdentifier, "SY") - } - - func test__country_identifier_for_Yemen() { - country = .Yemen - XCTAssertEqual(country.countryIdentifier, "YE") - } - - func test__country_identifier_for_Jordan() { - country = .Jordan - XCTAssertEqual(country.countryIdentifier, "JO") - } - - func test__country_identifier_for_Tunisia() { - country = .Tunisia - XCTAssertEqual(country.countryIdentifier, "TN") - } - - func test__country_identifier_for_Israel() { - country = .Israel - XCTAssertEqual(country.countryIdentifier, "IL") - } - - func test__country_identifier_for_World() { - country = .World - XCTAssertEqual(country.countryIdentifier, "001") - } -} - -class BengaliSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: BengaliSpeakingCountry! - - func test__country_identifier_for_Bangladesh() { - country = .Bangladesh - XCTAssertEqual(country.countryIdentifier, "BD") - } - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } -} - -class CatalanSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: CatalanSpeakingCountry! - - func test__country_identifier_for_Italy() { - country = .Italy - XCTAssertEqual(country.countryIdentifier, "IT") - } - - func test__country_identifier_for_France() { - country = .France - XCTAssertEqual(country.countryIdentifier, "FR") - } - - func test__country_identifier_for_Spain() { - country = .Spain - XCTAssertEqual(country.countryIdentifier, "ES") - } - - func test__country_identifier_for_Andorra() { - country = .Andorra - XCTAssertEqual(country.countryIdentifier, "AD") - } -} - -class CentralKurdishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: CentralKurdishSpeakingCountry! - - func test__country_identifier_for_Iraq() { - country = .Iraq - XCTAssertEqual(country.countryIdentifier, "IQ") - } - - func test__country_identifier_for_Iran() { - country = .Iran - XCTAssertEqual(country.countryIdentifier, "IR") - } -} - -class ChineseSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: ChineseSpeakingCountry! - - func test__country_identifier_for_Taiwan() { - country = .Taiwan - XCTAssertEqual(country.countryIdentifier, "TW") - } - - func test__country_identifier_for_HongKongChina() { - country = .HongKongChina - XCTAssertEqual(country.countryIdentifier, "HK") - } - - func test__country_identifier_for_MacauChina() { - country = .MacauChina - XCTAssertEqual(country.countryIdentifier, "MO") - } - - func test__country_identifier_for_Singapore() { - country = .Singapore - XCTAssertEqual(country.countryIdentifier, "SG") - } - - func test__country_identifier_for_China() { - country = .China - XCTAssertEqual(country.countryIdentifier, "CN") - } -} - -class CroatianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: CroatianSpeakingCountry! - - func test__country_identifier_for_Croatia() { - country = .Croatia - XCTAssertEqual(country.countryIdentifier, "HR") - } - - func test__country_identifier_for_BosniaHerzegovina() { - country = .BosniaHerzegovina - XCTAssertEqual(country.countryIdentifier, "BA") - } -} - -class DanishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: DanishSpeakingCountry! - - func test__country_identifier_for_Denmark() { - country = .Denmark - XCTAssertEqual(country.countryIdentifier, "DK") - } - - func test__country_identifier_for_Greenland() { - country = .Greenland - XCTAssertEqual(country.countryIdentifier, "GL") - } -} - -class DutchSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: DutchSpeakingCountry! - - func test__country_identifier_for_Belgium() { - country = .Belgium - XCTAssertEqual(country.countryIdentifier, "BE") - } - - func test__country_identifier_for_Curaçao() { - country = .Curaçao - XCTAssertEqual(country.countryIdentifier, "CW") - } - - func test__country_identifier_for_Suriname() { - country = .Suriname - XCTAssertEqual(country.countryIdentifier, "SR") - } - - func test__country_identifier_for_Netherlands() { - country = .Netherlands - XCTAssertEqual(country.countryIdentifier, "NL") - } - - func test__country_identifier_for_SintMaarten() { - country = .SintMaarten - XCTAssertEqual(country.countryIdentifier, "SX") - } - - func test__country_identifier_for_CaribbeanNetherlands() { - country = .CaribbeanNetherlands - XCTAssertEqual(country.countryIdentifier, "BQ") - } - - func test__country_identifier_for_Aruba() { - country = .Aruba - XCTAssertEqual(country.countryIdentifier, "AW") - } -} - -class EnglishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: EnglishSpeakingCountry! - - func test__country_identifier_for_Singapore() { - country = .Singapore - XCTAssertEqual(country.countryIdentifier, "SG") - } - - func test__country_identifier_for_Netherlands() { - country = .Netherlands - XCTAssertEqual(country.countryIdentifier, "NL") - } - - func test__country_identifier_for_Malaysia() { - country = .Malaysia - XCTAssertEqual(country.countryIdentifier, "MY") - } - - func test__country_identifier_for_PapuaNewGuinea() { - country = .PapuaNewGuinea - XCTAssertEqual(country.countryIdentifier, "PG") - } - - func test__country_identifier_for_Barbados() { - country = .Barbados - XCTAssertEqual(country.countryIdentifier, "BB") - } - - func test__country_identifier_for_HongKongChina() { - country = .HongKongChina - XCTAssertEqual(country.countryIdentifier, "HK") - } - - func test__country_identifier_for_Eritrea() { - country = .Eritrea - XCTAssertEqual(country.countryIdentifier, "ER") - } - - func test__country_identifier_for_IsleOfMan() { - country = .IsleOfMan - XCTAssertEqual(country.countryIdentifier, "IM") - } - - func test__country_identifier_for_Lesotho() { - country = .Lesotho - XCTAssertEqual(country.countryIdentifier, "LS") - } - - func test__country_identifier_for_Palau() { - country = .Palau - XCTAssertEqual(country.countryIdentifier, "PW") - } - - func test__country_identifier_for_SintMaarten() { - country = .SintMaarten - XCTAssertEqual(country.countryIdentifier, "SX") - } - - func test__country_identifier_for_Belgium() { - country = .Belgium - XCTAssertEqual(country.countryIdentifier, "BE") - } - - func test__country_identifier_for_BosniaHerzegovina() { - country = .BosniaHerzegovina - XCTAssertEqual(country.countryIdentifier, "BA") - } - - func test__country_identifier_for_Cameroon() { - country = .Cameroon - XCTAssertEqual(country.countryIdentifier, "CM") - } - - func test__country_identifier_for_Brazil() { - country = .Brazil - XCTAssertEqual(country.countryIdentifier, "BR") - } - - func test__country_identifier_for_Taiwan() { - country = .Taiwan - XCTAssertEqual(country.countryIdentifier, "TW") - } - - func test__country_identifier_for_Gibraltar() { - country = .Gibraltar - XCTAssertEqual(country.countryIdentifier, "GI") - } - - func test__country_identifier_for_Montenegro() { - country = .Montenegro - XCTAssertEqual(country.countryIdentifier, "ME") - } - - func test__country_identifier_for_Madagascar() { - country = .Madagascar - XCTAssertEqual(country.countryIdentifier, "MG") - } - - func test__country_identifier_for_CzechRepublic() { - country = .CzechRepublic - XCTAssertEqual(country.countryIdentifier, "CZ") - } - - func test__country_identifier_for_MarshallIslands() { - country = .MarshallIslands - XCTAssertEqual(country.countryIdentifier, "MH") - } - - func test__country_identifier_for_Swaziland() { - country = .Swaziland - XCTAssertEqual(country.countryIdentifier, "SZ") - } - - func test__country_identifier_for_Austria() { - country = .Austria - XCTAssertEqual(country.countryIdentifier, "AT") - } - - func test__country_identifier_for_Romania() { - country = .Romania - XCTAssertEqual(country.countryIdentifier, "RO") - } - - func test__country_identifier_for_Malawi() { - country = .Malawi - XCTAssertEqual(country.countryIdentifier, "MW") - } - - func test__country_identifier_for_Jersey() { - country = .Jersey - XCTAssertEqual(country.countryIdentifier, "JE") - } - - func test__country_identifier_for_Germany() { - country = .Germany - XCTAssertEqual(country.countryIdentifier, "DE") - } - - func test__country_identifier_for_Kiribati() { - country = .Kiribati - XCTAssertEqual(country.countryIdentifier, "KI") - } - - func test__country_identifier_for_Norway() { - country = .Norway - XCTAssertEqual(country.countryIdentifier, "NO") - } - - func test__country_identifier_for_MacauChina() { - country = .MacauChina - XCTAssertEqual(country.countryIdentifier, "MO") - } - - func test__country_identifier_for_Jamaica() { - country = .Jamaica - XCTAssertEqual(country.countryIdentifier, "JM") - } - - func test__country_identifier_for_ChristmasIsland() { - country = .ChristmasIsland - XCTAssertEqual(country.countryIdentifier, "CX") - } - - func test__country_identifier_for_Montserrat() { - country = .Montserrat - XCTAssertEqual(country.countryIdentifier, "MS") - } - - func test__country_identifier_for_SolomonIslands() { - country = .SolomonIslands - XCTAssertEqual(country.countryIdentifier, "SB") - } - - func test__country_identifier_for_USOutlyingIslands() { - country = .USOutlyingIslands - XCTAssertEqual(country.countryIdentifier, "UM") - } - - func test__country_identifier_for_Seychelles() { - country = .Seychelles - XCTAssertEqual(country.countryIdentifier, "SC") - } - - func test__country_identifier_for_CaymanIslands() { - country = .CaymanIslands - XCTAssertEqual(country.countryIdentifier, "KY") - } - - func test__country_identifier_for_Finland() { - country = .Finland - XCTAssertEqual(country.countryIdentifier, "FI") - } - - func test__country_identifier_for_AntiguaBarbuda() { - country = .AntiguaBarbuda - XCTAssertEqual(country.countryIdentifier, "AG") - } - - func test__country_identifier_for_Anguilla() { - country = .Anguilla - XCTAssertEqual(country.countryIdentifier, "AI") - } - - func test__country_identifier_for_Mauritius() { - country = .Mauritius - XCTAssertEqual(country.countryIdentifier, "MU") - } - - func test__country_identifier_for_Tonga() { - country = .Tonga - XCTAssertEqual(country.countryIdentifier, "TO") - } - - func test__country_identifier_for_Maldives() { - country = .Maldives - XCTAssertEqual(country.countryIdentifier, "MV") - } - - func test__country_identifier_for_Italy() { - country = .Italy - XCTAssertEqual(country.countryIdentifier, "IT") - } - - func test__country_identifier_for_Nigeria() { - country = .Nigeria - XCTAssertEqual(country.countryIdentifier, "NG") - } - - func test__country_identifier_for_Australia() { - country = .Australia - XCTAssertEqual(country.countryIdentifier, "AU") - } - - func test__country_identifier_for_SierraLeone() { - country = .SierraLeone - XCTAssertEqual(country.countryIdentifier, "SL") - } - - func test__country_identifier_for_BritishVirginIslands() { - country = .BritishVirginIslands - XCTAssertEqual(country.countryIdentifier, "VG") - } - - func test__country_identifier_for_Guernsey() { - country = .Guernsey - XCTAssertEqual(country.countryIdentifier, "GG") - } - - func test__country_identifier_for_SouthSudan() { - country = .SouthSudan - XCTAssertEqual(country.countryIdentifier, "SS") - } - - func test__country_identifier_for_Denmark() { - country = .Denmark - XCTAssertEqual(country.countryIdentifier, "DK") - } - - func test__country_identifier_for_Guam() { - country = .Guam - XCTAssertEqual(country.countryIdentifier, "GU") - } - - func test__country_identifier_for_Burundi() { - country = .Burundi - XCTAssertEqual(country.countryIdentifier, "BI") - } - - func test__country_identifier_for_Andorra() { - country = .Andorra - XCTAssertEqual(country.countryIdentifier, "AD") - } - - func test__country_identifier_for_Japan() { - country = .Japan - XCTAssertEqual(country.countryIdentifier, "JP") - } - - func test__country_identifier_for_Cyprus() { - country = .Cyprus - XCTAssertEqual(country.countryIdentifier, "CY") - } - - func test__country_identifier_for_Liberia() { - country = .Liberia - XCTAssertEqual(country.countryIdentifier, "LR") - } - - func test__country_identifier_for_StVincentGrenadines() { - country = .StVincentGrenadines - XCTAssertEqual(country.countryIdentifier, "VC") - } - - func test__country_identifier_for_UnitedStates() { - country = .UnitedStates - XCTAssertEqual(country.countryIdentifier, "US") - } - - func test__country_identifier_for_Uganda() { - country = .Uganda - XCTAssertEqual(country.countryIdentifier, "UG") - } - - func test__country_identifier_for_China() { - country = .China - XCTAssertEqual(country.countryIdentifier, "CN") - } - - func test__country_identifier_for_Slovakia() { - country = .Slovakia - XCTAssertEqual(country.countryIdentifier, "SK") - } - - func test__country_identifier_for_Bermuda() { - country = .Bermuda - XCTAssertEqual(country.countryIdentifier, "BM") - } - - func test__country_identifier_for_PitcairnIslands() { - country = .PitcairnIslands - XCTAssertEqual(country.countryIdentifier, "PN") - } - - func test__country_identifier_for_Slovenia() { - country = .Slovenia - XCTAssertEqual(country.countryIdentifier, "SI") - } - - func test__country_identifier_for_Switzerland() { - country = .Switzerland - XCTAssertEqual(country.countryIdentifier, "CH") - } - - func test__country_identifier_for_Lithuania() { - country = .Lithuania - XCTAssertEqual(country.countryIdentifier, "LT") - } - - func test__country_identifier_for_Tuvalu() { - country = .Tuvalu - XCTAssertEqual(country.countryIdentifier, "TV") - } - - func test__country_identifier_for_World() { - country = .World - XCTAssertEqual(country.countryIdentifier, "001") - } - - func test__country_identifier_for_TurksCaicosIslands() { - country = .TurksCaicosIslands - XCTAssertEqual(country.countryIdentifier, "TC") - } - - func test__country_identifier_for_Vanuatu() { - country = .Vanuatu - XCTAssertEqual(country.countryIdentifier, "VU") - } - - func test__country_identifier_for_NewZealand() { - country = .NewZealand - XCTAssertEqual(country.countryIdentifier, "NZ") - } - - func test__country_identifier_for_Latvia() { - country = .Latvia - XCTAssertEqual(country.countryIdentifier, "LV") - } - - func test__country_identifier_for_Ireland() { - country = .Ireland - XCTAssertEqual(country.countryIdentifier, "IE") - } - - func test__country_identifier_for_Guyana() { - country = .Guyana - XCTAssertEqual(country.countryIdentifier, "GY") - } - - func test__country_identifier_for_BritishIndianOceanTerritory() { - country = .BritishIndianOceanTerritory - XCTAssertEqual(country.countryIdentifier, "IO") - } - - func test__country_identifier_for_Philippines() { - country = .Philippines - XCTAssertEqual(country.countryIdentifier, "PH") - } - - func test__country_identifier_for_Niue() { - country = .Niue - XCTAssertEqual(country.countryIdentifier, "NU") - } - - func test__country_identifier_for_Gambia() { - country = .Gambia - XCTAssertEqual(country.countryIdentifier, "GM") - } - - func test__country_identifier_for_Spain() { - country = .Spain - XCTAssertEqual(country.countryIdentifier, "ES") - } - - func test__country_identifier_for_NorthernMarianaIslands() { - country = .NorthernMarianaIslands - XCTAssertEqual(country.countryIdentifier, "MP") - } - - func test__country_identifier_for_Estonia() { - country = .Estonia - XCTAssertEqual(country.countryIdentifier, "EE") - } - - func test__country_identifier_for_Greece() { - country = .Greece - XCTAssertEqual(country.countryIdentifier, "GR") - } - - func test__country_identifier_for_Canada() { - country = .Canada - XCTAssertEqual(country.countryIdentifier, "CA") - } - - func test__country_identifier_for_Sudan() { - country = .Sudan - XCTAssertEqual(country.countryIdentifier, "SD") - } - - func test__country_identifier_for_StLucia() { - country = .StLucia - XCTAssertEqual(country.countryIdentifier, "LC") - } - - func test__country_identifier_for_Croatia() { - country = .Croatia - XCTAssertEqual(country.countryIdentifier, "HR") - } - - func test__country_identifier_for_NorfolkIsland() { - country = .NorfolkIsland - XCTAssertEqual(country.countryIdentifier, "NF") - } - - func test__country_identifier_for_UnitedKingdom() { - country = .UnitedKingdom - XCTAssertEqual(country.countryIdentifier, "GB") - } - - func test__country_identifier_for_Dominica() { - country = .Dominica - XCTAssertEqual(country.countryIdentifier, "DM") - } - - func test__country_identifier_for_Europe() { - country = .Europe - XCTAssertEqual(country.countryIdentifier, "150") - } - - func test__country_identifier_for_Portugal() { - country = .Portugal - XCTAssertEqual(country.countryIdentifier, "PT") - } - - func test__country_identifier_for_Turkey() { - country = .Turkey - XCTAssertEqual(country.countryIdentifier, "TR") - } - - func test__country_identifier_for_Malta() { - country = .Malta - XCTAssertEqual(country.countryIdentifier, "MT") - } - - func test__country_identifier_for_Albania() { - country = .Albania - XCTAssertEqual(country.countryIdentifier, "AL") - } - - func test__country_identifier_for_TrinidadTobago() { - country = .TrinidadTobago - XCTAssertEqual(country.countryIdentifier, "TT") - } - - func test__country_identifier_for_Samoa() { - country = .Samoa - XCTAssertEqual(country.countryIdentifier, "WS") - } - - func test__country_identifier_for_Israel() { - country = .Israel - XCTAssertEqual(country.countryIdentifier, "IL") - } - - func test__country_identifier_for_DiegoGarcia() { - country = .DiegoGarcia - XCTAssertEqual(country.countryIdentifier, "DG") - } - - func test__country_identifier_for_Rwanda() { - country = .Rwanda - XCTAssertEqual(country.countryIdentifier, "RW") - } - - func test__country_identifier_for_Fiji() { - country = .Fiji - XCTAssertEqual(country.countryIdentifier, "FJ") - } - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } - - func test__country_identifier_for_Russia() { - country = .Russia - XCTAssertEqual(country.countryIdentifier, "RU") - } - - func test__country_identifier_for_Bahamas() { - country = .Bahamas - XCTAssertEqual(country.countryIdentifier, "BS") - } - - func test__country_identifier_for_Luxembourg() { - country = .Luxembourg - XCTAssertEqual(country.countryIdentifier, "LU") - } - - func test__country_identifier_for_Hungary() { - country = .Hungary - XCTAssertEqual(country.countryIdentifier, "HU") - } - - func test__country_identifier_for_Tanzania() { - country = .Tanzania - XCTAssertEqual(country.countryIdentifier, "TZ") - } - - func test__country_identifier_for_Namibia() { - country = .Namibia - XCTAssertEqual(country.countryIdentifier, "NA") - } - - func test__country_identifier_for_Zimbabwe() { - country = .Zimbabwe - XCTAssertEqual(country.countryIdentifier, "ZW") - } - - func test__country_identifier_for_SouthAfrica() { - country = .SouthAfrica - XCTAssertEqual(country.countryIdentifier, "ZA") - } - - func test__country_identifier_for_Grenada() { - country = .Grenada - XCTAssertEqual(country.countryIdentifier, "GD") - } - - func test__country_identifier_for_Belize() { - country = .Belize - XCTAssertEqual(country.countryIdentifier, "BZ") - } - - func test__country_identifier_for_Botswana() { - country = .Botswana - XCTAssertEqual(country.countryIdentifier, "BW") - } - - func test__country_identifier_for_PuertoRico() { - country = .PuertoRico - XCTAssertEqual(country.countryIdentifier, "PR") - } - - func test__country_identifier_for_USVirginIslands() { - country = .USVirginIslands - XCTAssertEqual(country.countryIdentifier, "VI") - } - - func test__country_identifier_for_Sweden() { - country = .Sweden - XCTAssertEqual(country.countryIdentifier, "SE") - } - - func test__country_identifier_for_FalklandIslands() { - country = .FalklandIslands - XCTAssertEqual(country.countryIdentifier, "FK") - } - - func test__country_identifier_for_CocosKeelingIslands() { - country = .CocosKeelingIslands - XCTAssertEqual(country.countryIdentifier, "CC") - } - - func test__country_identifier_for_France() { - country = .France - XCTAssertEqual(country.countryIdentifier, "FR") - } - - func test__country_identifier_for_StKittsNevis() { - country = .StKittsNevis - XCTAssertEqual(country.countryIdentifier, "KN") - } - - func test__country_identifier_for_Pakistan() { - country = .Pakistan - XCTAssertEqual(country.countryIdentifier, "PK") - } - - func test__country_identifier_for_Zambia() { - country = .Zambia - XCTAssertEqual(country.countryIdentifier, "ZM") - } - - func test__country_identifier_for_Poland() { - country = .Poland - XCTAssertEqual(country.countryIdentifier, "PL") - } - - func test__country_identifier_for_Tokelau() { - country = .Tokelau - XCTAssertEqual(country.countryIdentifier, "TK") - } - - func test__country_identifier_for_SouthKorea() { - country = .SouthKorea - XCTAssertEqual(country.countryIdentifier, "KR") - } - - func test__country_identifier_for_CookIslands() { - country = .CookIslands - XCTAssertEqual(country.countryIdentifier, "CK") - } - - func test__country_identifier_for_StHelena() { - country = .StHelena - XCTAssertEqual(country.countryIdentifier, "SH") - } - - func test__country_identifier_for_Nauru() { - country = .Nauru - XCTAssertEqual(country.countryIdentifier, "NR") - } - - func test__country_identifier_for_Ghana() { - country = .Ghana - XCTAssertEqual(country.countryIdentifier, "GH") - } - - func test__country_identifier_for_Iceland() { - country = .Iceland - XCTAssertEqual(country.countryIdentifier, "IS") - } - - func test__country_identifier_for_Micronesia() { - country = .Micronesia - XCTAssertEqual(country.countryIdentifier, "FM") - } - - func test__country_identifier_for_AmericanSamoa() { - country = .AmericanSamoa - XCTAssertEqual(country.countryIdentifier, "AS") - } - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } -} - -class EweSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: EweSpeakingCountry! - - func test__country_identifier_for_Togo() { - country = .Togo - XCTAssertEqual(country.countryIdentifier, "TG") - } - - func test__country_identifier_for_Ghana() { - country = .Ghana - XCTAssertEqual(country.countryIdentifier, "GH") - } -} - -class FaroeseSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: FaroeseSpeakingCountry! - - func test__country_identifier_for_FaroeIslands() { - country = .FaroeIslands - XCTAssertEqual(country.countryIdentifier, "FO") - } - - func test__country_identifier_for_Denmark() { - country = .Denmark - XCTAssertEqual(country.countryIdentifier, "DK") - } -} - -class FrenchSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: FrenchSpeakingCountry! - - func test__country_identifier_for_Rwanda() { - country = .Rwanda - XCTAssertEqual(country.countryIdentifier, "RW") - } - - func test__country_identifier_for_Seychelles() { - country = .Seychelles - XCTAssertEqual(country.countryIdentifier, "SC") - } - - func test__country_identifier_for_Vanuatu() { - country = .Vanuatu - XCTAssertEqual(country.countryIdentifier, "VU") - } - - func test__country_identifier_for_Mauritius() { - country = .Mauritius - XCTAssertEqual(country.countryIdentifier, "MU") - } - - func test__country_identifier_for_Chad() { - country = .Chad - XCTAssertEqual(country.countryIdentifier, "TD") - } - - func test__country_identifier_for_Djibouti() { - country = .Djibouti - XCTAssertEqual(country.countryIdentifier, "DJ") - } - - func test__country_identifier_for_CongoBrazzaville() { - country = .CongoBrazzaville - XCTAssertEqual(country.countryIdentifier, "CG") - } - - func test__country_identifier_for_Monaco() { - country = .Monaco - XCTAssertEqual(country.countryIdentifier, "MC") - } - - func test__country_identifier_for_Mauritania() { - country = .Mauritania - XCTAssertEqual(country.countryIdentifier, "MR") - } - - func test__country_identifier_for_Luxembourg() { - country = .Luxembourg - XCTAssertEqual(country.countryIdentifier, "LU") - } - - func test__country_identifier_for_Niger() { - country = .Niger - XCTAssertEqual(country.countryIdentifier, "NE") - } - - func test__country_identifier_for_StMartin() { - country = .StMartin - XCTAssertEqual(country.countryIdentifier, "MF") - } - - func test__country_identifier_for_Mayotte() { - country = .Mayotte - XCTAssertEqual(country.countryIdentifier, "YT") - } - - func test__country_identifier_for_Benin() { - country = .Benin - XCTAssertEqual(country.countryIdentifier, "BJ") - } - - func test__country_identifier_for_Canada() { - country = .Canada - XCTAssertEqual(country.countryIdentifier, "CA") - } - - func test__country_identifier_for_FrenchGuiana() { - country = .FrenchGuiana - XCTAssertEqual(country.countryIdentifier, "GF") - } - - func test__country_identifier_for_NewCaledonia() { - country = .NewCaledonia - XCTAssertEqual(country.countryIdentifier, "NC") - } - - func test__country_identifier_for_Haiti() { - country = .Haiti - XCTAssertEqual(country.countryIdentifier, "HT") - } - - func test__country_identifier_for_Senegal() { - country = .Senegal - XCTAssertEqual(country.countryIdentifier, "SN") - } - - func test__country_identifier_for_CentralAfricanRepublic() { - country = .CentralAfricanRepublic - XCTAssertEqual(country.countryIdentifier, "CF") - } - - func test__country_identifier_for_France() { - country = .France - XCTAssertEqual(country.countryIdentifier, "FR") - } - - func test__country_identifier_for_Belgium() { - country = .Belgium - XCTAssertEqual(country.countryIdentifier, "BE") - } - - func test__country_identifier_for_StPierreMiquelon() { - country = .StPierreMiquelon - XCTAssertEqual(country.countryIdentifier, "PM") - } - - func test__country_identifier_for_Togo() { - country = .Togo - XCTAssertEqual(country.countryIdentifier, "TG") - } - - func test__country_identifier_for_FrenchPolynesia() { - country = .FrenchPolynesia - XCTAssertEqual(country.countryIdentifier, "PF") - } - - func test__country_identifier_for_Morocco() { - country = .Morocco - XCTAssertEqual(country.countryIdentifier, "MA") - } - - func test__country_identifier_for_Cameroon() { - country = .Cameroon - XCTAssertEqual(country.countryIdentifier, "CM") - } - - func test__country_identifier_for_Burundi() { - country = .Burundi - XCTAssertEqual(country.countryIdentifier, "BI") - } - - func test__country_identifier_for_StBarthélemy() { - country = .StBarthélemy - XCTAssertEqual(country.countryIdentifier, "BL") - } - - func test__country_identifier_for_Madagascar() { - country = .Madagascar - XCTAssertEqual(country.countryIdentifier, "MG") - } - - func test__country_identifier_for_Algeria() { - country = .Algeria - XCTAssertEqual(country.countryIdentifier, "DZ") - } - - func test__country_identifier_for_Guinea() { - country = .Guinea - XCTAssertEqual(country.countryIdentifier, "GN") - } - - func test__country_identifier_for_BurkinaFaso() { - country = .BurkinaFaso - XCTAssertEqual(country.countryIdentifier, "BF") - } - - func test__country_identifier_for_Guadeloupe() { - country = .Guadeloupe - XCTAssertEqual(country.countryIdentifier, "GP") - } - - func test__country_identifier_for_CongoKinshasa() { - country = .CongoKinshasa - XCTAssertEqual(country.countryIdentifier, "CD") - } - - func test__country_identifier_for_Réunion() { - country = .Réunion - XCTAssertEqual(country.countryIdentifier, "RE") - } - - func test__country_identifier_for_Mali() { - country = .Mali - XCTAssertEqual(country.countryIdentifier, "ML") - } - - func test__country_identifier_for_Martinique() { - country = .Martinique - XCTAssertEqual(country.countryIdentifier, "MQ") - } - - func test__country_identifier_for_WallisFutuna() { - country = .WallisFutuna - XCTAssertEqual(country.countryIdentifier, "WF") - } - - func test__country_identifier_for_EquatorialGuinea() { - country = .EquatorialGuinea - XCTAssertEqual(country.countryIdentifier, "GQ") - } - - func test__country_identifier_for_Switzerland() { - country = .Switzerland - XCTAssertEqual(country.countryIdentifier, "CH") - } - - func test__country_identifier_for_CôteDivoire() { - country = .CôteDivoire - XCTAssertEqual(country.countryIdentifier, "CI") - } - - func test__country_identifier_for_Comoros() { - country = .Comoros - XCTAssertEqual(country.countryIdentifier, "KM") - } - - func test__country_identifier_for_Syria() { - country = .Syria - XCTAssertEqual(country.countryIdentifier, "SY") - } - - func test__country_identifier_for_Gabon() { - country = .Gabon - XCTAssertEqual(country.countryIdentifier, "GA") - } - - func test__country_identifier_for_Tunisia() { - country = .Tunisia - XCTAssertEqual(country.countryIdentifier, "TN") - } -} - -class FulahSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: FulahSpeakingCountry! - - func test__country_identifier_for_Senegal() { - country = .Senegal - XCTAssertEqual(country.countryIdentifier, "SN") - } - - func test__country_identifier_for_Cameroon() { - country = .Cameroon - XCTAssertEqual(country.countryIdentifier, "CM") - } - - func test__country_identifier_for_Mauritania() { - country = .Mauritania - XCTAssertEqual(country.countryIdentifier, "MR") - } - - func test__country_identifier_for_Guinea() { - country = .Guinea - XCTAssertEqual(country.countryIdentifier, "GN") - } -} - -class GermanSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: GermanSpeakingCountry! - - func test__country_identifier_for_Belgium() { - country = .Belgium - XCTAssertEqual(country.countryIdentifier, "BE") - } - - func test__country_identifier_for_Austria() { - country = .Austria - XCTAssertEqual(country.countryIdentifier, "AT") - } - - func test__country_identifier_for_Liechtenstein() { - country = .Liechtenstein - XCTAssertEqual(country.countryIdentifier, "LI") - } - - func test__country_identifier_for_Luxembourg() { - country = .Luxembourg - XCTAssertEqual(country.countryIdentifier, "LU") - } - - func test__country_identifier_for_Switzerland() { - country = .Switzerland - XCTAssertEqual(country.countryIdentifier, "CH") - } - - func test__country_identifier_for_Germany() { - country = .Germany - XCTAssertEqual(country.countryIdentifier, "DE") - } -} - -class GreekSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: GreekSpeakingCountry! - - func test__country_identifier_for_Cyprus() { - country = .Cyprus - XCTAssertEqual(country.countryIdentifier, "CY") - } - - func test__country_identifier_for_Greece() { - country = .Greece - XCTAssertEqual(country.countryIdentifier, "GR") - } -} - -class HausaSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: HausaSpeakingCountry! - - func test__country_identifier_for_Niger() { - country = .Niger - XCTAssertEqual(country.countryIdentifier, "NE") - } - - func test__country_identifier_for_Ghana() { - country = .Ghana - XCTAssertEqual(country.countryIdentifier, "GH") - } - - func test__country_identifier_for_Nigeria() { - country = .Nigeria - XCTAssertEqual(country.countryIdentifier, "NG") - } -} - -class ItalianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: ItalianSpeakingCountry! - - func test__country_identifier_for_Italy() { - country = .Italy - XCTAssertEqual(country.countryIdentifier, "IT") - } - - func test__country_identifier_for_Switzerland() { - country = .Switzerland - XCTAssertEqual(country.countryIdentifier, "CH") - } - - func test__country_identifier_for_SanMarino() { - country = .SanMarino - XCTAssertEqual(country.countryIdentifier, "SM") - } -} - -class KoreanSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: KoreanSpeakingCountry! - - func test__country_identifier_for_NorthKorea() { - country = .NorthKorea - XCTAssertEqual(country.countryIdentifier, "KP") - } - - func test__country_identifier_for_SouthKorea() { - country = .SouthKorea - XCTAssertEqual(country.countryIdentifier, "KR") - } -} - -class LingalaSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: LingalaSpeakingCountry! - - func test__country_identifier_for_CongoKinshasa() { - country = .CongoKinshasa - XCTAssertEqual(country.countryIdentifier, "CD") - } - - func test__country_identifier_for_CentralAfricanRepublic() { - country = .CentralAfricanRepublic - XCTAssertEqual(country.countryIdentifier, "CF") - } - - func test__country_identifier_for_Angola() { - country = .Angola - XCTAssertEqual(country.countryIdentifier, "AO") - } - - func test__country_identifier_for_CongoBrazzaville() { - country = .CongoBrazzaville - XCTAssertEqual(country.countryIdentifier, "CG") - } -} - -class MalaySpeakingCountryAutogeneratedTests: XCTestCase { - - var country: MalaySpeakingCountry! - - func test__country_identifier_for_Brunei() { - country = .Brunei - XCTAssertEqual(country.countryIdentifier, "BN") - } - - func test__country_identifier_for_Malaysia() { - country = .Malaysia - XCTAssertEqual(country.countryIdentifier, "MY") - } - - func test__country_identifier_for_Singapore() { - country = .Singapore - XCTAssertEqual(country.countryIdentifier, "SG") - } -} - -class MasaiSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: MasaiSpeakingCountry! - - func test__country_identifier_for_Tanzania() { - country = .Tanzania - XCTAssertEqual(country.countryIdentifier, "TZ") - } - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } -} - -class NepaliSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: NepaliSpeakingCountry! - - func test__country_identifier_for_Nepal() { - country = .Nepal - XCTAssertEqual(country.countryIdentifier, "NP") - } - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } -} - -class NorthernLuriSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: NorthernLuriSpeakingCountry! - - func test__country_identifier_for_Iraq() { - country = .Iraq - XCTAssertEqual(country.countryIdentifier, "IQ") - } - - func test__country_identifier_for_Iran() { - country = .Iran - XCTAssertEqual(country.countryIdentifier, "IR") - } -} - -class NorthernSamiSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: NorthernSamiSpeakingCountry! - - func test__country_identifier_for_Sweden() { - country = .Sweden - XCTAssertEqual(country.countryIdentifier, "SE") - } - - func test__country_identifier_for_Norway() { - country = .Norway - XCTAssertEqual(country.countryIdentifier, "NO") - } - - func test__country_identifier_for_Finland() { - country = .Finland - XCTAssertEqual(country.countryIdentifier, "FI") - } -} - -class NorwegianBokmålSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: NorwegianBokmålSpeakingCountry! - - func test__country_identifier_for_SvalbardJanMayen() { - country = .SvalbardJanMayen - XCTAssertEqual(country.countryIdentifier, "SJ") - } - - func test__country_identifier_for_Norway() { - country = .Norway - XCTAssertEqual(country.countryIdentifier, "NO") - } -} - -class OromoSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: OromoSpeakingCountry! - - func test__country_identifier_for_Ethiopia() { - country = .Ethiopia - XCTAssertEqual(country.countryIdentifier, "ET") - } - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } -} - -class OsseticSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: OsseticSpeakingCountry! - - func test__country_identifier_for_Georgia() { - country = .Georgia - XCTAssertEqual(country.countryIdentifier, "GE") - } - - func test__country_identifier_for_Russia() { - country = .Russia - XCTAssertEqual(country.countryIdentifier, "RU") - } -} - -class PersianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: PersianSpeakingCountry! - - func test__country_identifier_for_Iran() { - country = .Iran - XCTAssertEqual(country.countryIdentifier, "IR") - } - - func test__country_identifier_for_Afghanistan() { - country = .Afghanistan - XCTAssertEqual(country.countryIdentifier, "AF") - } -} - -class PortugueseSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: PortugueseSpeakingCountry! - - func test__country_identifier_for_Brazil() { - country = .Brazil - XCTAssertEqual(country.countryIdentifier, "BR") - } - - func test__country_identifier_for_GuineaBissau() { - country = .GuineaBissau - XCTAssertEqual(country.countryIdentifier, "GW") - } - - func test__country_identifier_for_TimorLeste() { - country = .TimorLeste - XCTAssertEqual(country.countryIdentifier, "TL") - } - - func test__country_identifier_for_SãoToméPríncipe() { - country = .SãoToméPríncipe - XCTAssertEqual(country.countryIdentifier, "ST") - } - - func test__country_identifier_for_Portugal() { - country = .Portugal - XCTAssertEqual(country.countryIdentifier, "PT") - } - - func test__country_identifier_for_Angola() { - country = .Angola - XCTAssertEqual(country.countryIdentifier, "AO") - } - - func test__country_identifier_for_MacauChina() { - country = .MacauChina - XCTAssertEqual(country.countryIdentifier, "MO") - } - - func test__country_identifier_for_Mozambique() { - country = .Mozambique - XCTAssertEqual(country.countryIdentifier, "MZ") - } - - func test__country_identifier_for_CapeVerde() { - country = .CapeVerde - XCTAssertEqual(country.countryIdentifier, "CV") - } -} - -class PunjabiSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: PunjabiSpeakingCountry! - - func test__country_identifier_for_Pakistan() { - country = .Pakistan - XCTAssertEqual(country.countryIdentifier, "PK") - } - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } -} - -class QuechuaSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: QuechuaSpeakingCountry! - - func test__country_identifier_for_Bolivia() { - country = .Bolivia - XCTAssertEqual(country.countryIdentifier, "BO") - } - - func test__country_identifier_for_Ecuador() { - country = .Ecuador - XCTAssertEqual(country.countryIdentifier, "EC") - } - - func test__country_identifier_for_Peru() { - country = .Peru - XCTAssertEqual(country.countryIdentifier, "PE") - } -} - -class RomanianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: RomanianSpeakingCountry! - - func test__country_identifier_for_Romania() { - country = .Romania - XCTAssertEqual(country.countryIdentifier, "RO") - } - - func test__country_identifier_for_Moldova() { - country = .Moldova - XCTAssertEqual(country.countryIdentifier, "MD") - } -} - -class RussianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: RussianSpeakingCountry! - - func test__country_identifier_for_Kyrgyzstan() { - country = .Kyrgyzstan - XCTAssertEqual(country.countryIdentifier, "KG") - } - - func test__country_identifier_for_Belarus() { - country = .Belarus - XCTAssertEqual(country.countryIdentifier, "BY") - } - - func test__country_identifier_for_Russia() { - country = .Russia - XCTAssertEqual(country.countryIdentifier, "RU") - } - - func test__country_identifier_for_Ukraine() { - country = .Ukraine - XCTAssertEqual(country.countryIdentifier, "UA") - } - - func test__country_identifier_for_Moldova() { - country = .Moldova - XCTAssertEqual(country.countryIdentifier, "MD") - } - - func test__country_identifier_for_Kazakhstan() { - country = .Kazakhstan - XCTAssertEqual(country.countryIdentifier, "KZ") - } -} - -class SerbianSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SerbianSpeakingCountry! - - func test__country_identifier_for_Montenegro() { - country = .Montenegro - XCTAssertEqual(country.countryIdentifier, "ME") - } - - func test__country_identifier_for_BosniaHerzegovina() { - country = .BosniaHerzegovina - XCTAssertEqual(country.countryIdentifier, "BA") - } - - func test__country_identifier_for_Serbia() { - country = .Serbia - XCTAssertEqual(country.countryIdentifier, "RS") - } - - func test__country_identifier_for_Kosovo() { - country = .Kosovo - XCTAssertEqual(country.countryIdentifier, "XK") - } -} - -class SomaliSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SomaliSpeakingCountry! - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } - - func test__country_identifier_for_Somalia() { - country = .Somalia - XCTAssertEqual(country.countryIdentifier, "SO") - } - - func test__country_identifier_for_Ethiopia() { - country = .Ethiopia - XCTAssertEqual(country.countryIdentifier, "ET") - } - - func test__country_identifier_for_Djibouti() { - country = .Djibouti - XCTAssertEqual(country.countryIdentifier, "DJ") - } -} - -class SpanishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SpanishSpeakingCountry! - - func test__country_identifier_for_Bolivia() { - country = .Bolivia - XCTAssertEqual(country.countryIdentifier, "BO") - } - - func test__country_identifier_for_Peru() { - country = .Peru - XCTAssertEqual(country.countryIdentifier, "PE") - } - - func test__country_identifier_for_Panama() { - country = .Panama - XCTAssertEqual(country.countryIdentifier, "PA") - } - - func test__country_identifier_for_Venezuela() { - country = .Venezuela - XCTAssertEqual(country.countryIdentifier, "VE") - } - - func test__country_identifier_for_Philippines() { - country = .Philippines - XCTAssertEqual(country.countryIdentifier, "PH") - } - - func test__country_identifier_for_Spain() { - country = .Spain - XCTAssertEqual(country.countryIdentifier, "ES") - } - - func test__country_identifier_for_LatinAmerica() { - country = .LatinAmerica - XCTAssertEqual(country.countryIdentifier, "419") - } - - func test__country_identifier_for_Paraguay() { - country = .Paraguay - XCTAssertEqual(country.countryIdentifier, "PY") - } - - func test__country_identifier_for_Colombia() { - country = .Colombia - XCTAssertEqual(country.countryIdentifier, "CO") - } - - func test__country_identifier_for_Nicaragua() { - country = .Nicaragua - XCTAssertEqual(country.countryIdentifier, "NI") - } - - func test__country_identifier_for_Chile() { - country = .Chile - XCTAssertEqual(country.countryIdentifier, "CL") - } - - func test__country_identifier_for_CanaryIslands() { - country = .CanaryIslands - XCTAssertEqual(country.countryIdentifier, "IC") - } - - func test__country_identifier_for_PuertoRico() { - country = .PuertoRico - XCTAssertEqual(country.countryIdentifier, "PR") - } - - func test__country_identifier_for_Honduras() { - country = .Honduras - XCTAssertEqual(country.countryIdentifier, "HN") - } - - func test__country_identifier_for_Mexico() { - country = .Mexico - XCTAssertEqual(country.countryIdentifier, "MX") - } - - func test__country_identifier_for_Uruguay() { - country = .Uruguay - XCTAssertEqual(country.countryIdentifier, "UY") - } - - func test__country_identifier_for_CeutaMelilla() { - country = .CeutaMelilla - XCTAssertEqual(country.countryIdentifier, "EA") - } - - func test__country_identifier_for_UnitedStates() { - country = .UnitedStates - XCTAssertEqual(country.countryIdentifier, "US") - } - - func test__country_identifier_for_ElSalvador() { - country = .ElSalvador - XCTAssertEqual(country.countryIdentifier, "SV") - } - - func test__country_identifier_for_Argentina() { - country = .Argentina - XCTAssertEqual(country.countryIdentifier, "AR") - } - - func test__country_identifier_for_Ecuador() { - country = .Ecuador - XCTAssertEqual(country.countryIdentifier, "EC") - } - - func test__country_identifier_for_EquatorialGuinea() { - country = .EquatorialGuinea - XCTAssertEqual(country.countryIdentifier, "GQ") - } - - func test__country_identifier_for_Guatemala() { - country = .Guatemala - XCTAssertEqual(country.countryIdentifier, "GT") - } - - func test__country_identifier_for_Cuba() { - country = .Cuba - XCTAssertEqual(country.countryIdentifier, "CU") - } - - func test__country_identifier_for_DominicanRepublic() { - country = .DominicanRepublic - XCTAssertEqual(country.countryIdentifier, "DO") - } - - func test__country_identifier_for_CostaRica() { - country = .CostaRica - XCTAssertEqual(country.countryIdentifier, "CR") - } -} - -class SwahiliSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SwahiliSpeakingCountry! - - func test__country_identifier_for_CongoKinshasa() { - country = .CongoKinshasa - XCTAssertEqual(country.countryIdentifier, "CD") - } - - func test__country_identifier_for_Tanzania() { - country = .Tanzania - XCTAssertEqual(country.countryIdentifier, "TZ") - } - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } - - func test__country_identifier_for_Uganda() { - country = .Uganda - XCTAssertEqual(country.countryIdentifier, "UG") - } -} - -class SwedishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SwedishSpeakingCountry! - - func test__country_identifier_for_Sweden() { - country = .Sweden - XCTAssertEqual(country.countryIdentifier, "SE") - } - - func test__country_identifier_for_ÅlandIslands() { - country = .ÅlandIslands - XCTAssertEqual(country.countryIdentifier, "AX") - } - - func test__country_identifier_for_Finland() { - country = .Finland - XCTAssertEqual(country.countryIdentifier, "FI") - } -} - -class SwissGermanSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: SwissGermanSpeakingCountry! - - func test__country_identifier_for_Switzerland() { - country = .Switzerland - XCTAssertEqual(country.countryIdentifier, "CH") - } - - func test__country_identifier_for_France() { - country = .France - XCTAssertEqual(country.countryIdentifier, "FR") - } - - func test__country_identifier_for_Liechtenstein() { - country = .Liechtenstein - XCTAssertEqual(country.countryIdentifier, "LI") - } -} - -class TamilSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: TamilSpeakingCountry! - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } - - func test__country_identifier_for_Singapore() { - country = .Singapore - XCTAssertEqual(country.countryIdentifier, "SG") - } - - func test__country_identifier_for_Malaysia() { - country = .Malaysia - XCTAssertEqual(country.countryIdentifier, "MY") - } - - func test__country_identifier_for_SriLanka() { - country = .SriLanka - XCTAssertEqual(country.countryIdentifier, "LK") - } -} - -class TesoSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: TesoSpeakingCountry! - - func test__country_identifier_for_Kenya() { - country = .Kenya - XCTAssertEqual(country.countryIdentifier, "KE") - } - - func test__country_identifier_for_Uganda() { - country = .Uganda - XCTAssertEqual(country.countryIdentifier, "UG") - } -} - -class TibetanSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: TibetanSpeakingCountry! - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } - - func test__country_identifier_for_China() { - country = .China - XCTAssertEqual(country.countryIdentifier, "CN") - } -} - -class TigrinyaSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: TigrinyaSpeakingCountry! - - func test__country_identifier_for_Ethiopia() { - country = .Ethiopia - XCTAssertEqual(country.countryIdentifier, "ET") - } - - func test__country_identifier_for_Eritrea() { - country = .Eritrea - XCTAssertEqual(country.countryIdentifier, "ER") - } -} - -class TurkishSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: TurkishSpeakingCountry! - - func test__country_identifier_for_Cyprus() { - country = .Cyprus - XCTAssertEqual(country.countryIdentifier, "CY") - } - - func test__country_identifier_for_Turkey() { - country = .Turkey - XCTAssertEqual(country.countryIdentifier, "TR") - } -} - -class UrduSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: UrduSpeakingCountry! - - func test__country_identifier_for_Pakistan() { - country = .Pakistan - XCTAssertEqual(country.countryIdentifier, "PK") - } - - func test__country_identifier_for_India() { - country = .India - XCTAssertEqual(country.countryIdentifier, "IN") - } -} - -class UzbekSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: UzbekSpeakingCountry! - - func test__country_identifier_for_Uzbekistan() { - country = .Uzbekistan - XCTAssertEqual(country.countryIdentifier, "UZ") - } - - func test__country_identifier_for_Afghanistan() { - country = .Afghanistan - XCTAssertEqual(country.countryIdentifier, "AF") - } -} - -class YorubaSpeakingCountryAutogeneratedTests: XCTestCase { - - var country: YorubaSpeakingCountry! - - func test__country_identifier_for_Benin() { - country = .Benin - XCTAssertEqual(country.countryIdentifier, "BJ") - } - - func test__country_identifier_for_Nigeria() { - country = .Nigeria - XCTAssertEqual(country.countryIdentifier, "NG") - } -} - -// MARK: - Locale Tests - -class MNYLocaleAfrikaansLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Afrikaans_Namibia() { - locale = .Afrikaans(.Namibia) - XCTAssertEqual(locale.languageIdentifier, "af") - XCTAssertEqual(locale.localeIdentifier, "af_NA") - } - - func test__language_identifier_for_Afrikaans_SouthAfrica() { - locale = .Afrikaans(.SouthAfrica) - XCTAssertEqual(locale.languageIdentifier, "af") - XCTAssertEqual(locale.localeIdentifier, "af_ZA") - } -} - -class MNYLocaleAlbanianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Albanian_Macedonia() { - locale = .Albanian(.Macedonia) - XCTAssertEqual(locale.languageIdentifier, "sq") - XCTAssertEqual(locale.localeIdentifier, "sq_MK") - } - - func test__language_identifier_for_Albanian_Albania() { - locale = .Albanian(.Albania) - XCTAssertEqual(locale.languageIdentifier, "sq") - XCTAssertEqual(locale.localeIdentifier, "sq_AL") - } - - func test__language_identifier_for_Albanian_Kosovo() { - locale = .Albanian(.Kosovo) - XCTAssertEqual(locale.languageIdentifier, "sq") - XCTAssertEqual(locale.localeIdentifier, "sq_XK") - } -} - -class MNYLocaleArabicLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Arabic_Somalia() { - locale = .Arabic(.Somalia) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_SO") - } - - func test__language_identifier_for_Arabic_Iraq() { - locale = .Arabic(.Iraq) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_IQ") - } - - func test__language_identifier_for_Arabic_Kuwait() { - locale = .Arabic(.Kuwait) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_KW") - } - - func test__language_identifier_for_Arabic_Chad() { - locale = .Arabic(.Chad) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_TD") - } - - func test__language_identifier_for_Arabic_Libya() { - locale = .Arabic(.Libya) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_LY") - } - - func test__language_identifier_for_Arabic_Egypt() { - locale = .Arabic(.Egypt) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_EG") - } - - func test__language_identifier_for_Arabic_WesternSahara() { - locale = .Arabic(.WesternSahara) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_EH") - } - - func test__language_identifier_for_Arabic_SaudiArabia() { - locale = .Arabic(.SaudiArabia) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_SA") - } - - func test__language_identifier_for_Arabic_Mauritania() { - locale = .Arabic(.Mauritania) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_MR") - } - - func test__language_identifier_for_Arabic_Djibouti() { - locale = .Arabic(.Djibouti) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_DJ") - } - - func test__language_identifier_for_Arabic_Eritrea() { - locale = .Arabic(.Eritrea) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_ER") - } - - func test__language_identifier_for_Arabic_Lebanon() { - locale = .Arabic(.Lebanon) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_LB") - } - - func test__language_identifier_for_Arabic_Oman() { - locale = .Arabic(.Oman) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_OM") - } - - func test__language_identifier_for_Arabic_PalestinianTerritories() { - locale = .Arabic(.PalestinianTerritories) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_PS") - } - - func test__language_identifier_for_Arabic_Sudan() { - locale = .Arabic(.Sudan) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_SD") - } - - func test__language_identifier_for_Arabic_SouthSudan() { - locale = .Arabic(.SouthSudan) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_SS") - } - - func test__language_identifier_for_Arabic_Algeria() { - locale = .Arabic(.Algeria) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_DZ") - } - - func test__language_identifier_for_Arabic_Morocco() { - locale = .Arabic(.Morocco) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_MA") - } - - func test__language_identifier_for_Arabic_Bahrain() { - locale = .Arabic(.Bahrain) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_BH") - } - - func test__language_identifier_for_Arabic_UnitedArabEmirates() { - locale = .Arabic(.UnitedArabEmirates) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_AE") - } - - func test__language_identifier_for_Arabic_Qatar() { - locale = .Arabic(.Qatar) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_QA") - } - - func test__language_identifier_for_Arabic_Comoros() { - locale = .Arabic(.Comoros) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_KM") - } - - func test__language_identifier_for_Arabic_Syria() { - locale = .Arabic(.Syria) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_SY") - } - - func test__language_identifier_for_Arabic_Yemen() { - locale = .Arabic(.Yemen) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_YE") - } - - func test__language_identifier_for_Arabic_Jordan() { - locale = .Arabic(.Jordan) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_JO") - } - - func test__language_identifier_for_Arabic_Tunisia() { - locale = .Arabic(.Tunisia) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_TN") - } - - func test__language_identifier_for_Arabic_Israel() { - locale = .Arabic(.Israel) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_IL") - } - - func test__language_identifier_for_Arabic_World() { - locale = .Arabic(.World) - XCTAssertEqual(locale.languageIdentifier, "ar") - XCTAssertEqual(locale.localeIdentifier, "ar_001") - } -} - -class MNYLocaleBengaliLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Bengali_Bangladesh() { - locale = .Bengali(.Bangladesh) - XCTAssertEqual(locale.languageIdentifier, "bn") - XCTAssertEqual(locale.localeIdentifier, "bn_BD") - } - - func test__language_identifier_for_Bengali_India() { - locale = .Bengali(.India) - XCTAssertEqual(locale.languageIdentifier, "bn") - XCTAssertEqual(locale.localeIdentifier, "bn_IN") - } -} - -class MNYLocaleCatalanLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Catalan_Italy() { - locale = .Catalan(.Italy) - XCTAssertEqual(locale.languageIdentifier, "ca") - XCTAssertEqual(locale.localeIdentifier, "ca_IT") - } - - func test__language_identifier_for_Catalan_France() { - locale = .Catalan(.France) - XCTAssertEqual(locale.languageIdentifier, "ca") - XCTAssertEqual(locale.localeIdentifier, "ca_FR") - } - - func test__language_identifier_for_Catalan_Spain() { - locale = .Catalan(.Spain) - XCTAssertEqual(locale.languageIdentifier, "ca") - XCTAssertEqual(locale.localeIdentifier, "ca_ES") - } - - func test__language_identifier_for_Catalan_Andorra() { - locale = .Catalan(.Andorra) - XCTAssertEqual(locale.languageIdentifier, "ca") - XCTAssertEqual(locale.localeIdentifier, "ca_AD") - } -} - -class MNYLocaleCentralKurdishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_CentralKurdish_Iraq() { - locale = .CentralKurdish(.Iraq) - XCTAssertEqual(locale.languageIdentifier, "ckb") - XCTAssertEqual(locale.localeIdentifier, "ckb_IQ") - } - - func test__language_identifier_for_CentralKurdish_Iran() { - locale = .CentralKurdish(.Iran) - XCTAssertEqual(locale.languageIdentifier, "ckb") - XCTAssertEqual(locale.localeIdentifier, "ckb_IR") - } -} - -class MNYLocaleChineseLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Chinese_Taiwan() { - locale = .Chinese(.Taiwan) - XCTAssertEqual(locale.languageIdentifier, "zh") - XCTAssertEqual(locale.localeIdentifier, "zh_TW") - } - - func test__language_identifier_for_Chinese_HongKongChina() { - locale = .Chinese(.HongKongChina) - XCTAssertEqual(locale.languageIdentifier, "zh") - XCTAssertEqual(locale.localeIdentifier, "zh_HK") - } - - func test__language_identifier_for_Chinese_MacauChina() { - locale = .Chinese(.MacauChina) - XCTAssertEqual(locale.languageIdentifier, "zh") - XCTAssertEqual(locale.localeIdentifier, "zh_MO") - } - - func test__language_identifier_for_Chinese_Singapore() { - locale = .Chinese(.Singapore) - XCTAssertEqual(locale.languageIdentifier, "zh") - XCTAssertEqual(locale.localeIdentifier, "zh_SG") - } - - func test__language_identifier_for_Chinese_China() { - locale = .Chinese(.China) - XCTAssertEqual(locale.languageIdentifier, "zh") - XCTAssertEqual(locale.localeIdentifier, "zh_CN") - } -} - -class MNYLocaleCroatianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Croatian_Croatia() { - locale = .Croatian(.Croatia) - XCTAssertEqual(locale.languageIdentifier, "hr") - XCTAssertEqual(locale.localeIdentifier, "hr_HR") - } - - func test__language_identifier_for_Croatian_BosniaHerzegovina() { - locale = .Croatian(.BosniaHerzegovina) - XCTAssertEqual(locale.languageIdentifier, "hr") - XCTAssertEqual(locale.localeIdentifier, "hr_BA") - } -} - -class MNYLocaleDanishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Danish_Denmark() { - locale = .Danish(.Denmark) - XCTAssertEqual(locale.languageIdentifier, "da") - XCTAssertEqual(locale.localeIdentifier, "da_DK") - } - - func test__language_identifier_for_Danish_Greenland() { - locale = .Danish(.Greenland) - XCTAssertEqual(locale.languageIdentifier, "da") - XCTAssertEqual(locale.localeIdentifier, "da_GL") - } -} - -class MNYLocaleDutchLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Dutch_Belgium() { - locale = .Dutch(.Belgium) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_BE") - } - - func test__language_identifier_for_Dutch_Curaçao() { - locale = .Dutch(.Curaçao) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_CW") - } - - func test__language_identifier_for_Dutch_Suriname() { - locale = .Dutch(.Suriname) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_SR") - } - - func test__language_identifier_for_Dutch_Netherlands() { - locale = .Dutch(.Netherlands) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_NL") - } - - func test__language_identifier_for_Dutch_SintMaarten() { - locale = .Dutch(.SintMaarten) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_SX") - } - - func test__language_identifier_for_Dutch_CaribbeanNetherlands() { - locale = .Dutch(.CaribbeanNetherlands) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_BQ") - } - - func test__language_identifier_for_Dutch_Aruba() { - locale = .Dutch(.Aruba) - XCTAssertEqual(locale.languageIdentifier, "nl") - XCTAssertEqual(locale.localeIdentifier, "nl_AW") - } -} - -class MNYLocaleEnglishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_English_Singapore() { - locale = .English(.Singapore) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SG") - } - - func test__language_identifier_for_English_Netherlands() { - locale = .English(.Netherlands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NL") - } - - func test__language_identifier_for_English_Malaysia() { - locale = .English(.Malaysia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MY") - } - - func test__language_identifier_for_English_PapuaNewGuinea() { - locale = .English(.PapuaNewGuinea) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PG") - } - - func test__language_identifier_for_English_Barbados() { - locale = .English(.Barbados) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BB") - } - - func test__language_identifier_for_English_HongKongChina() { - locale = .English(.HongKongChina) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_HK") - } - - func test__language_identifier_for_English_Eritrea() { - locale = .English(.Eritrea) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ER") - } - - func test__language_identifier_for_English_IsleOfMan() { - locale = .English(.IsleOfMan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IM") - } - - func test__language_identifier_for_English_Lesotho() { - locale = .English(.Lesotho) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LS") - } - - func test__language_identifier_for_English_Palau() { - locale = .English(.Palau) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PW") - } - - func test__language_identifier_for_English_SintMaarten() { - locale = .English(.SintMaarten) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SX") - } - - func test__language_identifier_for_English_Belgium() { - locale = .English(.Belgium) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BE") - } - - func test__language_identifier_for_English_BosniaHerzegovina() { - locale = .English(.BosniaHerzegovina) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BA") - } - - func test__language_identifier_for_English_Cameroon() { - locale = .English(.Cameroon) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CM") - } - - func test__language_identifier_for_English_Brazil() { - locale = .English(.Brazil) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BR") - } - - func test__language_identifier_for_English_Taiwan() { - locale = .English(.Taiwan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TW") - } - - func test__language_identifier_for_English_Gibraltar() { - locale = .English(.Gibraltar) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GI") - } - - func test__language_identifier_for_English_Montenegro() { - locale = .English(.Montenegro) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ME") - } - - func test__language_identifier_for_English_Madagascar() { - locale = .English(.Madagascar) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MG") - } - - func test__language_identifier_for_English_CzechRepublic() { - locale = .English(.CzechRepublic) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CZ") - } - - func test__language_identifier_for_English_MarshallIslands() { - locale = .English(.MarshallIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MH") - } - - func test__language_identifier_for_English_Swaziland() { - locale = .English(.Swaziland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SZ") - } - - func test__language_identifier_for_English_Austria() { - locale = .English(.Austria) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AT") - } - - func test__language_identifier_for_English_Romania() { - locale = .English(.Romania) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_RO") - } - - func test__language_identifier_for_English_Malawi() { - locale = .English(.Malawi) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MW") - } - - func test__language_identifier_for_English_Jersey() { - locale = .English(.Jersey) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_JE") - } - - func test__language_identifier_for_English_Germany() { - locale = .English(.Germany) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_DE") - } - - func test__language_identifier_for_English_Kiribati() { - locale = .English(.Kiribati) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_KI") - } - - func test__language_identifier_for_English_Norway() { - locale = .English(.Norway) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NO") - } - - func test__language_identifier_for_English_MacauChina() { - locale = .English(.MacauChina) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MO") - } - - func test__language_identifier_for_English_Jamaica() { - locale = .English(.Jamaica) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_JM") - } - - func test__language_identifier_for_English_ChristmasIsland() { - locale = .English(.ChristmasIsland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CX") - } - - func test__language_identifier_for_English_Montserrat() { - locale = .English(.Montserrat) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MS") - } - - func test__language_identifier_for_English_SolomonIslands() { - locale = .English(.SolomonIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SB") - } - - func test__language_identifier_for_English_USOutlyingIslands() { - locale = .English(.USOutlyingIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_UM") - } - - func test__language_identifier_for_English_Seychelles() { - locale = .English(.Seychelles) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SC") - } - - func test__language_identifier_for_English_CaymanIslands() { - locale = .English(.CaymanIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_KY") - } - - func test__language_identifier_for_English_Finland() { - locale = .English(.Finland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_FI") - } - - func test__language_identifier_for_English_AntiguaBarbuda() { - locale = .English(.AntiguaBarbuda) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AG") - } - - func test__language_identifier_for_English_Anguilla() { - locale = .English(.Anguilla) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AI") - } - - func test__language_identifier_for_English_Mauritius() { - locale = .English(.Mauritius) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MU") - } - - func test__language_identifier_for_English_Tonga() { - locale = .English(.Tonga) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TO") - } - - func test__language_identifier_for_English_Maldives() { - locale = .English(.Maldives) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MV") - } - - func test__language_identifier_for_English_Italy() { - locale = .English(.Italy) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IT") - } - - func test__language_identifier_for_English_Nigeria() { - locale = .English(.Nigeria) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NG") - } - - func test__language_identifier_for_English_Australia() { - locale = .English(.Australia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AU") - } - - func test__language_identifier_for_English_SierraLeone() { - locale = .English(.SierraLeone) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SL") - } - - func test__language_identifier_for_English_BritishVirginIslands() { - locale = .English(.BritishVirginIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_VG") - } - - func test__language_identifier_for_English_Guernsey() { - locale = .English(.Guernsey) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GG") - } - - func test__language_identifier_for_English_SouthSudan() { - locale = .English(.SouthSudan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SS") - } - - func test__language_identifier_for_English_Denmark() { - locale = .English(.Denmark) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_DK") - } - - func test__language_identifier_for_English_Guam() { - locale = .English(.Guam) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GU") - } - - func test__language_identifier_for_English_Burundi() { - locale = .English(.Burundi) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BI") - } - - func test__language_identifier_for_English_Andorra() { - locale = .English(.Andorra) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AD") - } - - func test__language_identifier_for_English_Japan() { - locale = .English(.Japan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_JP") - } - - func test__language_identifier_for_English_Cyprus() { - locale = .English(.Cyprus) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CY") - } - - func test__language_identifier_for_English_Liberia() { - locale = .English(.Liberia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LR") - } - - func test__language_identifier_for_English_StVincentGrenadines() { - locale = .English(.StVincentGrenadines) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_VC") - } - - func test__language_identifier_for_English_UnitedStates() { - locale = .English(.UnitedStates) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_US") - } - - func test__language_identifier_for_English_Uganda() { - locale = .English(.Uganda) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_UG") - } - - func test__language_identifier_for_English_China() { - locale = .English(.China) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CN") - } - - func test__language_identifier_for_English_Slovakia() { - locale = .English(.Slovakia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SK") - } - - func test__language_identifier_for_English_Bermuda() { - locale = .English(.Bermuda) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BM") - } - - func test__language_identifier_for_English_PitcairnIslands() { - locale = .English(.PitcairnIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PN") - } - - func test__language_identifier_for_English_Slovenia() { - locale = .English(.Slovenia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SI") - } - - func test__language_identifier_for_English_Switzerland() { - locale = .English(.Switzerland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CH") - } - - func test__language_identifier_for_English_Lithuania() { - locale = .English(.Lithuania) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LT") - } - - func test__language_identifier_for_English_Tuvalu() { - locale = .English(.Tuvalu) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TV") - } - - func test__language_identifier_for_English_World() { - locale = .English(.World) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_001") - } - - func test__language_identifier_for_English_TurksCaicosIslands() { - locale = .English(.TurksCaicosIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TC") - } - - func test__language_identifier_for_English_Vanuatu() { - locale = .English(.Vanuatu) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_VU") - } - - func test__language_identifier_for_English_NewZealand() { - locale = .English(.NewZealand) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NZ") - } - - func test__language_identifier_for_English_Latvia() { - locale = .English(.Latvia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LV") - } - - func test__language_identifier_for_English_Ireland() { - locale = .English(.Ireland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IE") - } - - func test__language_identifier_for_English_Guyana() { - locale = .English(.Guyana) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GY") - } - - func test__language_identifier_for_English_BritishIndianOceanTerritory() { - locale = .English(.BritishIndianOceanTerritory) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IO") - } - - func test__language_identifier_for_English_Philippines() { - locale = .English(.Philippines) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PH") - } - - func test__language_identifier_for_English_Niue() { - locale = .English(.Niue) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NU") - } - - func test__language_identifier_for_English_Gambia() { - locale = .English(.Gambia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GM") - } - - func test__language_identifier_for_English_Spain() { - locale = .English(.Spain) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ES") - } - - func test__language_identifier_for_English_NorthernMarianaIslands() { - locale = .English(.NorthernMarianaIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MP") - } - - func test__language_identifier_for_English_Estonia() { - locale = .English(.Estonia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_EE") - } - - func test__language_identifier_for_English_Greece() { - locale = .English(.Greece) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GR") - } - - func test__language_identifier_for_English_Canada() { - locale = .English(.Canada) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CA") - } - - func test__language_identifier_for_English_Sudan() { - locale = .English(.Sudan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SD") - } - - func test__language_identifier_for_English_StLucia() { - locale = .English(.StLucia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LC") - } - - func test__language_identifier_for_English_Croatia() { - locale = .English(.Croatia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_HR") - } - - func test__language_identifier_for_English_NorfolkIsland() { - locale = .English(.NorfolkIsland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NF") - } - - func test__language_identifier_for_English_UnitedKingdom() { - locale = .English(.UnitedKingdom) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GB") - } - - func test__language_identifier_for_English_Dominica() { - locale = .English(.Dominica) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_DM") - } - - func test__language_identifier_for_English_Europe() { - locale = .English(.Europe) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_150") - } - - func test__language_identifier_for_English_Portugal() { - locale = .English(.Portugal) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PT") - } - - func test__language_identifier_for_English_Turkey() { - locale = .English(.Turkey) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TR") - } - - func test__language_identifier_for_English_Malta() { - locale = .English(.Malta) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_MT") - } - - func test__language_identifier_for_English_Albania() { - locale = .English(.Albania) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AL") - } - - func test__language_identifier_for_English_TrinidadTobago() { - locale = .English(.TrinidadTobago) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TT") - } - - func test__language_identifier_for_English_Samoa() { - locale = .English(.Samoa) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_WS") - } - - func test__language_identifier_for_English_Israel() { - locale = .English(.Israel) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IL") - } - - func test__language_identifier_for_English_DiegoGarcia() { - locale = .English(.DiegoGarcia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_DG") - } - - func test__language_identifier_for_English_Rwanda() { - locale = .English(.Rwanda) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_RW") - } - - func test__language_identifier_for_English_Fiji() { - locale = .English(.Fiji) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_FJ") - } - - func test__language_identifier_for_English_Kenya() { - locale = .English(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_KE") - } - - func test__language_identifier_for_English_Russia() { - locale = .English(.Russia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_RU") - } - - func test__language_identifier_for_English_Bahamas() { - locale = .English(.Bahamas) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BS") - } - - func test__language_identifier_for_English_Luxembourg() { - locale = .English(.Luxembourg) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_LU") - } - - func test__language_identifier_for_English_Hungary() { - locale = .English(.Hungary) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_HU") - } - - func test__language_identifier_for_English_Tanzania() { - locale = .English(.Tanzania) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TZ") - } - - func test__language_identifier_for_English_Namibia() { - locale = .English(.Namibia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NA") - } - - func test__language_identifier_for_English_Zimbabwe() { - locale = .English(.Zimbabwe) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ZW") - } - - func test__language_identifier_for_English_SouthAfrica() { - locale = .English(.SouthAfrica) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ZA") - } - - func test__language_identifier_for_English_Grenada() { - locale = .English(.Grenada) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GD") - } - - func test__language_identifier_for_English_Belize() { - locale = .English(.Belize) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BZ") - } - - func test__language_identifier_for_English_Botswana() { - locale = .English(.Botswana) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_BW") - } - - func test__language_identifier_for_English_PuertoRico() { - locale = .English(.PuertoRico) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PR") - } - - func test__language_identifier_for_English_USVirginIslands() { - locale = .English(.USVirginIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_VI") - } - - func test__language_identifier_for_English_Sweden() { - locale = .English(.Sweden) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SE") - } - - func test__language_identifier_for_English_FalklandIslands() { - locale = .English(.FalklandIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_FK") - } - - func test__language_identifier_for_English_CocosKeelingIslands() { - locale = .English(.CocosKeelingIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CC") - } - - func test__language_identifier_for_English_France() { - locale = .English(.France) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_FR") - } - - func test__language_identifier_for_English_StKittsNevis() { - locale = .English(.StKittsNevis) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_KN") - } - - func test__language_identifier_for_English_Pakistan() { - locale = .English(.Pakistan) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PK") - } - - func test__language_identifier_for_English_Zambia() { - locale = .English(.Zambia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_ZM") - } - - func test__language_identifier_for_English_Poland() { - locale = .English(.Poland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_PL") - } - - func test__language_identifier_for_English_Tokelau() { - locale = .English(.Tokelau) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_TK") - } - - func test__language_identifier_for_English_SouthKorea() { - locale = .English(.SouthKorea) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_KR") - } - - func test__language_identifier_for_English_CookIslands() { - locale = .English(.CookIslands) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_CK") - } - - func test__language_identifier_for_English_StHelena() { - locale = .English(.StHelena) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_SH") - } - - func test__language_identifier_for_English_Nauru() { - locale = .English(.Nauru) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_NR") - } - - func test__language_identifier_for_English_Ghana() { - locale = .English(.Ghana) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_GH") - } - - func test__language_identifier_for_English_Iceland() { - locale = .English(.Iceland) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IS") - } - - func test__language_identifier_for_English_Micronesia() { - locale = .English(.Micronesia) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_FM") - } - - func test__language_identifier_for_English_AmericanSamoa() { - locale = .English(.AmericanSamoa) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_AS") - } - - func test__language_identifier_for_English_India() { - locale = .English(.India) - XCTAssertEqual(locale.languageIdentifier, "en") - XCTAssertEqual(locale.localeIdentifier, "en_IN") - } -} - -class MNYLocaleEweLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Ewe_Togo() { - locale = .Ewe(.Togo) - XCTAssertEqual(locale.languageIdentifier, "ee") - XCTAssertEqual(locale.localeIdentifier, "ee_TG") - } - - func test__language_identifier_for_Ewe_Ghana() { - locale = .Ewe(.Ghana) - XCTAssertEqual(locale.languageIdentifier, "ee") - XCTAssertEqual(locale.localeIdentifier, "ee_GH") - } -} - -class MNYLocaleFaroeseLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Faroese_FaroeIslands() { - locale = .Faroese(.FaroeIslands) - XCTAssertEqual(locale.languageIdentifier, "fo") - XCTAssertEqual(locale.localeIdentifier, "fo_FO") - } - - func test__language_identifier_for_Faroese_Denmark() { - locale = .Faroese(.Denmark) - XCTAssertEqual(locale.languageIdentifier, "fo") - XCTAssertEqual(locale.localeIdentifier, "fo_DK") - } -} - -class MNYLocaleFrenchLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_French_Rwanda() { - locale = .French(.Rwanda) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_RW") - } - - func test__language_identifier_for_French_Seychelles() { - locale = .French(.Seychelles) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_SC") - } - - func test__language_identifier_for_French_Vanuatu() { - locale = .French(.Vanuatu) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_VU") - } - - func test__language_identifier_for_French_Mauritius() { - locale = .French(.Mauritius) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MU") - } - - func test__language_identifier_for_French_Chad() { - locale = .French(.Chad) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_TD") - } - - func test__language_identifier_for_French_Djibouti() { - locale = .French(.Djibouti) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_DJ") - } - - func test__language_identifier_for_French_CongoBrazzaville() { - locale = .French(.CongoBrazzaville) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CG") - } - - func test__language_identifier_for_French_Monaco() { - locale = .French(.Monaco) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MC") - } - - func test__language_identifier_for_French_Mauritania() { - locale = .French(.Mauritania) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MR") - } - - func test__language_identifier_for_French_Luxembourg() { - locale = .French(.Luxembourg) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_LU") - } - - func test__language_identifier_for_French_Niger() { - locale = .French(.Niger) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_NE") - } - - func test__language_identifier_for_French_StMartin() { - locale = .French(.StMartin) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MF") - } - - func test__language_identifier_for_French_Mayotte() { - locale = .French(.Mayotte) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_YT") - } - - func test__language_identifier_for_French_Benin() { - locale = .French(.Benin) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_BJ") - } - - func test__language_identifier_for_French_Canada() { - locale = .French(.Canada) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CA") - } - - func test__language_identifier_for_French_FrenchGuiana() { - locale = .French(.FrenchGuiana) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_GF") - } - - func test__language_identifier_for_French_NewCaledonia() { - locale = .French(.NewCaledonia) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_NC") - } - - func test__language_identifier_for_French_Haiti() { - locale = .French(.Haiti) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_HT") - } - - func test__language_identifier_for_French_Senegal() { - locale = .French(.Senegal) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_SN") - } - - func test__language_identifier_for_French_CentralAfricanRepublic() { - locale = .French(.CentralAfricanRepublic) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CF") - } - - func test__language_identifier_for_French_France() { - locale = .French(.France) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_FR") - } - - func test__language_identifier_for_French_Belgium() { - locale = .French(.Belgium) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_BE") - } - - func test__language_identifier_for_French_StPierreMiquelon() { - locale = .French(.StPierreMiquelon) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_PM") - } - - func test__language_identifier_for_French_Togo() { - locale = .French(.Togo) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_TG") - } - - func test__language_identifier_for_French_FrenchPolynesia() { - locale = .French(.FrenchPolynesia) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_PF") - } - - func test__language_identifier_for_French_Morocco() { - locale = .French(.Morocco) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MA") - } - - func test__language_identifier_for_French_Cameroon() { - locale = .French(.Cameroon) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CM") - } - - func test__language_identifier_for_French_Burundi() { - locale = .French(.Burundi) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_BI") - } - - func test__language_identifier_for_French_StBarthélemy() { - locale = .French(.StBarthélemy) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_BL") - } - - func test__language_identifier_for_French_Madagascar() { - locale = .French(.Madagascar) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MG") - } - - func test__language_identifier_for_French_Algeria() { - locale = .French(.Algeria) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_DZ") - } - - func test__language_identifier_for_French_Guinea() { - locale = .French(.Guinea) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_GN") - } - - func test__language_identifier_for_French_BurkinaFaso() { - locale = .French(.BurkinaFaso) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_BF") - } - - func test__language_identifier_for_French_Guadeloupe() { - locale = .French(.Guadeloupe) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_GP") - } - - func test__language_identifier_for_French_CongoKinshasa() { - locale = .French(.CongoKinshasa) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CD") - } - - func test__language_identifier_for_French_Réunion() { - locale = .French(.Réunion) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_RE") - } - - func test__language_identifier_for_French_Mali() { - locale = .French(.Mali) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_ML") - } - - func test__language_identifier_for_French_Martinique() { - locale = .French(.Martinique) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_MQ") - } - - func test__language_identifier_for_French_WallisFutuna() { - locale = .French(.WallisFutuna) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_WF") - } - - func test__language_identifier_for_French_EquatorialGuinea() { - locale = .French(.EquatorialGuinea) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_GQ") - } - - func test__language_identifier_for_French_Switzerland() { - locale = .French(.Switzerland) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CH") - } - - func test__language_identifier_for_French_CôteDivoire() { - locale = .French(.CôteDivoire) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_CI") - } - - func test__language_identifier_for_French_Comoros() { - locale = .French(.Comoros) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_KM") - } - - func test__language_identifier_for_French_Syria() { - locale = .French(.Syria) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_SY") - } - - func test__language_identifier_for_French_Gabon() { - locale = .French(.Gabon) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_GA") - } - - func test__language_identifier_for_French_Tunisia() { - locale = .French(.Tunisia) - XCTAssertEqual(locale.languageIdentifier, "fr") - XCTAssertEqual(locale.localeIdentifier, "fr_TN") - } -} - -class MNYLocaleFulahLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Fulah_Senegal() { - locale = .Fulah(.Senegal) - XCTAssertEqual(locale.languageIdentifier, "ff") - XCTAssertEqual(locale.localeIdentifier, "ff_SN") - } - - func test__language_identifier_for_Fulah_Cameroon() { - locale = .Fulah(.Cameroon) - XCTAssertEqual(locale.languageIdentifier, "ff") - XCTAssertEqual(locale.localeIdentifier, "ff_CM") - } - - func test__language_identifier_for_Fulah_Mauritania() { - locale = .Fulah(.Mauritania) - XCTAssertEqual(locale.languageIdentifier, "ff") - XCTAssertEqual(locale.localeIdentifier, "ff_MR") - } - - func test__language_identifier_for_Fulah_Guinea() { - locale = .Fulah(.Guinea) - XCTAssertEqual(locale.languageIdentifier, "ff") - XCTAssertEqual(locale.localeIdentifier, "ff_GN") - } -} - -class MNYLocaleGermanLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_German_Belgium() { - locale = .German(.Belgium) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_BE") - } - - func test__language_identifier_for_German_Austria() { - locale = .German(.Austria) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_AT") - } - - func test__language_identifier_for_German_Liechtenstein() { - locale = .German(.Liechtenstein) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_LI") - } - - func test__language_identifier_for_German_Luxembourg() { - locale = .German(.Luxembourg) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_LU") - } - - func test__language_identifier_for_German_Switzerland() { - locale = .German(.Switzerland) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_CH") - } - - func test__language_identifier_for_German_Germany() { - locale = .German(.Germany) - XCTAssertEqual(locale.languageIdentifier, "de") - XCTAssertEqual(locale.localeIdentifier, "de_DE") - } -} - -class MNYLocaleGreekLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Greek_Cyprus() { - locale = .Greek(.Cyprus) - XCTAssertEqual(locale.languageIdentifier, "el") - XCTAssertEqual(locale.localeIdentifier, "el_CY") - } - - func test__language_identifier_for_Greek_Greece() { - locale = .Greek(.Greece) - XCTAssertEqual(locale.languageIdentifier, "el") - XCTAssertEqual(locale.localeIdentifier, "el_GR") - } -} - -class MNYLocaleHausaLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Hausa_Niger() { - locale = .Hausa(.Niger) - XCTAssertEqual(locale.languageIdentifier, "ha") - XCTAssertEqual(locale.localeIdentifier, "ha_NE") - } - - func test__language_identifier_for_Hausa_Ghana() { - locale = .Hausa(.Ghana) - XCTAssertEqual(locale.languageIdentifier, "ha") - XCTAssertEqual(locale.localeIdentifier, "ha_GH") - } - - func test__language_identifier_for_Hausa_Nigeria() { - locale = .Hausa(.Nigeria) - XCTAssertEqual(locale.languageIdentifier, "ha") - XCTAssertEqual(locale.localeIdentifier, "ha_NG") - } -} - -class MNYLocaleItalianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Italian_Italy() { - locale = .Italian(.Italy) - XCTAssertEqual(locale.languageIdentifier, "it") - XCTAssertEqual(locale.localeIdentifier, "it_IT") - } - - func test__language_identifier_for_Italian_Switzerland() { - locale = .Italian(.Switzerland) - XCTAssertEqual(locale.languageIdentifier, "it") - XCTAssertEqual(locale.localeIdentifier, "it_CH") - } - - func test__language_identifier_for_Italian_SanMarino() { - locale = .Italian(.SanMarino) - XCTAssertEqual(locale.languageIdentifier, "it") - XCTAssertEqual(locale.localeIdentifier, "it_SM") - } -} - -class MNYLocaleKoreanLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Korean_NorthKorea() { - locale = .Korean(.NorthKorea) - XCTAssertEqual(locale.languageIdentifier, "ko") - XCTAssertEqual(locale.localeIdentifier, "ko_KP") - } - - func test__language_identifier_for_Korean_SouthKorea() { - locale = .Korean(.SouthKorea) - XCTAssertEqual(locale.languageIdentifier, "ko") - XCTAssertEqual(locale.localeIdentifier, "ko_KR") - } -} - -class MNYLocaleLingalaLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Lingala_CongoKinshasa() { - locale = .Lingala(.CongoKinshasa) - XCTAssertEqual(locale.languageIdentifier, "ln") - XCTAssertEqual(locale.localeIdentifier, "ln_CD") - } - - func test__language_identifier_for_Lingala_CentralAfricanRepublic() { - locale = .Lingala(.CentralAfricanRepublic) - XCTAssertEqual(locale.languageIdentifier, "ln") - XCTAssertEqual(locale.localeIdentifier, "ln_CF") - } - - func test__language_identifier_for_Lingala_Angola() { - locale = .Lingala(.Angola) - XCTAssertEqual(locale.languageIdentifier, "ln") - XCTAssertEqual(locale.localeIdentifier, "ln_AO") - } - - func test__language_identifier_for_Lingala_CongoBrazzaville() { - locale = .Lingala(.CongoBrazzaville) - XCTAssertEqual(locale.languageIdentifier, "ln") - XCTAssertEqual(locale.localeIdentifier, "ln_CG") - } -} - -class MNYLocaleMalayLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Malay_Brunei() { - locale = .Malay(.Brunei) - XCTAssertEqual(locale.languageIdentifier, "ms") - XCTAssertEqual(locale.localeIdentifier, "ms_BN") - } - - func test__language_identifier_for_Malay_Malaysia() { - locale = .Malay(.Malaysia) - XCTAssertEqual(locale.languageIdentifier, "ms") - XCTAssertEqual(locale.localeIdentifier, "ms_MY") - } - - func test__language_identifier_for_Malay_Singapore() { - locale = .Malay(.Singapore) - XCTAssertEqual(locale.languageIdentifier, "ms") - XCTAssertEqual(locale.localeIdentifier, "ms_SG") - } -} - -class MNYLocaleMasaiLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Masai_Tanzania() { - locale = .Masai(.Tanzania) - XCTAssertEqual(locale.languageIdentifier, "mas") - XCTAssertEqual(locale.localeIdentifier, "mas_TZ") - } - - func test__language_identifier_for_Masai_Kenya() { - locale = .Masai(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "mas") - XCTAssertEqual(locale.localeIdentifier, "mas_KE") - } -} - -class MNYLocaleNepaliLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Nepali_Nepal() { - locale = .Nepali(.Nepal) - XCTAssertEqual(locale.languageIdentifier, "ne") - XCTAssertEqual(locale.localeIdentifier, "ne_NP") - } - - func test__language_identifier_for_Nepali_India() { - locale = .Nepali(.India) - XCTAssertEqual(locale.languageIdentifier, "ne") - XCTAssertEqual(locale.localeIdentifier, "ne_IN") - } -} - -class MNYLocaleNorthernLuriLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_NorthernLuri_Iraq() { - locale = .NorthernLuri(.Iraq) - XCTAssertEqual(locale.languageIdentifier, "lrc") - XCTAssertEqual(locale.localeIdentifier, "lrc_IQ") - } - - func test__language_identifier_for_NorthernLuri_Iran() { - locale = .NorthernLuri(.Iran) - XCTAssertEqual(locale.languageIdentifier, "lrc") - XCTAssertEqual(locale.localeIdentifier, "lrc_IR") - } -} - -class MNYLocaleNorthernSamiLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_NorthernSami_Sweden() { - locale = .NorthernSami(.Sweden) - XCTAssertEqual(locale.languageIdentifier, "se") - XCTAssertEqual(locale.localeIdentifier, "se_SE") - } - - func test__language_identifier_for_NorthernSami_Norway() { - locale = .NorthernSami(.Norway) - XCTAssertEqual(locale.languageIdentifier, "se") - XCTAssertEqual(locale.localeIdentifier, "se_NO") - } - - func test__language_identifier_for_NorthernSami_Finland() { - locale = .NorthernSami(.Finland) - XCTAssertEqual(locale.languageIdentifier, "se") - XCTAssertEqual(locale.localeIdentifier, "se_FI") - } -} - -class MNYLocaleNorwegianBokmålLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_NorwegianBokmål_SvalbardJanMayen() { - locale = .NorwegianBokmål(.SvalbardJanMayen) - XCTAssertEqual(locale.languageIdentifier, "nb") - XCTAssertEqual(locale.localeIdentifier, "nb_SJ") - } - - func test__language_identifier_for_NorwegianBokmål_Norway() { - locale = .NorwegianBokmål(.Norway) - XCTAssertEqual(locale.languageIdentifier, "nb") - XCTAssertEqual(locale.localeIdentifier, "nb_NO") - } -} - -class MNYLocaleOromoLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Oromo_Ethiopia() { - locale = .Oromo(.Ethiopia) - XCTAssertEqual(locale.languageIdentifier, "om") - XCTAssertEqual(locale.localeIdentifier, "om_ET") - } - - func test__language_identifier_for_Oromo_Kenya() { - locale = .Oromo(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "om") - XCTAssertEqual(locale.localeIdentifier, "om_KE") - } -} - -class MNYLocaleOsseticLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Ossetic_Georgia() { - locale = .Ossetic(.Georgia) - XCTAssertEqual(locale.languageIdentifier, "os") - XCTAssertEqual(locale.localeIdentifier, "os_GE") - } - - func test__language_identifier_for_Ossetic_Russia() { - locale = .Ossetic(.Russia) - XCTAssertEqual(locale.languageIdentifier, "os") - XCTAssertEqual(locale.localeIdentifier, "os_RU") - } -} - -class MNYLocalePersianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Persian_Iran() { - locale = .Persian(.Iran) - XCTAssertEqual(locale.languageIdentifier, "fa") - XCTAssertEqual(locale.localeIdentifier, "fa_IR") - } - - func test__language_identifier_for_Persian_Afghanistan() { - locale = .Persian(.Afghanistan) - XCTAssertEqual(locale.languageIdentifier, "fa") - XCTAssertEqual(locale.localeIdentifier, "fa_AF") - } -} - -class MNYLocalePortugueseLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Portuguese_Brazil() { - locale = .Portuguese(.Brazil) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_BR") - } - - func test__language_identifier_for_Portuguese_GuineaBissau() { - locale = .Portuguese(.GuineaBissau) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_GW") - } - - func test__language_identifier_for_Portuguese_TimorLeste() { - locale = .Portuguese(.TimorLeste) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_TL") - } - - func test__language_identifier_for_Portuguese_SãoToméPríncipe() { - locale = .Portuguese(.SãoToméPríncipe) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_ST") - } - - func test__language_identifier_for_Portuguese_Portugal() { - locale = .Portuguese(.Portugal) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_PT") - } - - func test__language_identifier_for_Portuguese_Angola() { - locale = .Portuguese(.Angola) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_AO") - } - - func test__language_identifier_for_Portuguese_MacauChina() { - locale = .Portuguese(.MacauChina) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_MO") - } - - func test__language_identifier_for_Portuguese_Mozambique() { - locale = .Portuguese(.Mozambique) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_MZ") - } - - func test__language_identifier_for_Portuguese_CapeVerde() { - locale = .Portuguese(.CapeVerde) - XCTAssertEqual(locale.languageIdentifier, "pt") - XCTAssertEqual(locale.localeIdentifier, "pt_CV") - } -} - -class MNYLocalePunjabiLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Punjabi_Pakistan() { - locale = .Punjabi(.Pakistan) - XCTAssertEqual(locale.languageIdentifier, "pa") - XCTAssertEqual(locale.localeIdentifier, "pa_PK") - } - - func test__language_identifier_for_Punjabi_India() { - locale = .Punjabi(.India) - XCTAssertEqual(locale.languageIdentifier, "pa") - XCTAssertEqual(locale.localeIdentifier, "pa_IN") - } -} - -class MNYLocaleQuechuaLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Quechua_Bolivia() { - locale = .Quechua(.Bolivia) - XCTAssertEqual(locale.languageIdentifier, "qu") - XCTAssertEqual(locale.localeIdentifier, "qu_BO") - } - - func test__language_identifier_for_Quechua_Ecuador() { - locale = .Quechua(.Ecuador) - XCTAssertEqual(locale.languageIdentifier, "qu") - XCTAssertEqual(locale.localeIdentifier, "qu_EC") - } - - func test__language_identifier_for_Quechua_Peru() { - locale = .Quechua(.Peru) - XCTAssertEqual(locale.languageIdentifier, "qu") - XCTAssertEqual(locale.localeIdentifier, "qu_PE") - } -} - -class MNYLocaleRomanianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Romanian_Romania() { - locale = .Romanian(.Romania) - XCTAssertEqual(locale.languageIdentifier, "ro") - XCTAssertEqual(locale.localeIdentifier, "ro_RO") - } - - func test__language_identifier_for_Romanian_Moldova() { - locale = .Romanian(.Moldova) - XCTAssertEqual(locale.languageIdentifier, "ro") - XCTAssertEqual(locale.localeIdentifier, "ro_MD") - } -} - -class MNYLocaleRussianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Russian_Kyrgyzstan() { - locale = .Russian(.Kyrgyzstan) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_KG") - } - - func test__language_identifier_for_Russian_Belarus() { - locale = .Russian(.Belarus) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_BY") - } - - func test__language_identifier_for_Russian_Russia() { - locale = .Russian(.Russia) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_RU") - } - - func test__language_identifier_for_Russian_Ukraine() { - locale = .Russian(.Ukraine) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_UA") - } - - func test__language_identifier_for_Russian_Moldova() { - locale = .Russian(.Moldova) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_MD") - } - - func test__language_identifier_for_Russian_Kazakhstan() { - locale = .Russian(.Kazakhstan) - XCTAssertEqual(locale.languageIdentifier, "ru") - XCTAssertEqual(locale.localeIdentifier, "ru_KZ") - } -} - -class MNYLocaleSerbianLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Serbian_Montenegro() { - locale = .Serbian(.Montenegro) - XCTAssertEqual(locale.languageIdentifier, "sr") - XCTAssertEqual(locale.localeIdentifier, "sr_ME") - } - - func test__language_identifier_for_Serbian_BosniaHerzegovina() { - locale = .Serbian(.BosniaHerzegovina) - XCTAssertEqual(locale.languageIdentifier, "sr") - XCTAssertEqual(locale.localeIdentifier, "sr_BA") - } - - func test__language_identifier_for_Serbian_Serbia() { - locale = .Serbian(.Serbia) - XCTAssertEqual(locale.languageIdentifier, "sr") - XCTAssertEqual(locale.localeIdentifier, "sr_RS") - } - - func test__language_identifier_for_Serbian_Kosovo() { - locale = .Serbian(.Kosovo) - XCTAssertEqual(locale.languageIdentifier, "sr") - XCTAssertEqual(locale.localeIdentifier, "sr_XK") - } -} - -class MNYLocaleSomaliLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Somali_Kenya() { - locale = .Somali(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "so") - XCTAssertEqual(locale.localeIdentifier, "so_KE") - } - - func test__language_identifier_for_Somali_Somalia() { - locale = .Somali(.Somalia) - XCTAssertEqual(locale.languageIdentifier, "so") - XCTAssertEqual(locale.localeIdentifier, "so_SO") - } - - func test__language_identifier_for_Somali_Ethiopia() { - locale = .Somali(.Ethiopia) - XCTAssertEqual(locale.languageIdentifier, "so") - XCTAssertEqual(locale.localeIdentifier, "so_ET") - } - - func test__language_identifier_for_Somali_Djibouti() { - locale = .Somali(.Djibouti) - XCTAssertEqual(locale.languageIdentifier, "so") - XCTAssertEqual(locale.localeIdentifier, "so_DJ") - } -} - -class MNYLocaleSpanishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Spanish_Bolivia() { - locale = .Spanish(.Bolivia) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_BO") - } - - func test__language_identifier_for_Spanish_Peru() { - locale = .Spanish(.Peru) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_PE") - } - - func test__language_identifier_for_Spanish_Panama() { - locale = .Spanish(.Panama) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_PA") - } - - func test__language_identifier_for_Spanish_Venezuela() { - locale = .Spanish(.Venezuela) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_VE") - } - - func test__language_identifier_for_Spanish_Philippines() { - locale = .Spanish(.Philippines) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_PH") - } - - func test__language_identifier_for_Spanish_Spain() { - locale = .Spanish(.Spain) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_ES") - } - - func test__language_identifier_for_Spanish_LatinAmerica() { - locale = .Spanish(.LatinAmerica) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_419") - } - - func test__language_identifier_for_Spanish_Paraguay() { - locale = .Spanish(.Paraguay) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_PY") - } - - func test__language_identifier_for_Spanish_Colombia() { - locale = .Spanish(.Colombia) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_CO") - } - - func test__language_identifier_for_Spanish_Nicaragua() { - locale = .Spanish(.Nicaragua) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_NI") - } - - func test__language_identifier_for_Spanish_Chile() { - locale = .Spanish(.Chile) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_CL") - } - - func test__language_identifier_for_Spanish_CanaryIslands() { - locale = .Spanish(.CanaryIslands) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_IC") - } - - func test__language_identifier_for_Spanish_PuertoRico() { - locale = .Spanish(.PuertoRico) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_PR") - } - - func test__language_identifier_for_Spanish_Honduras() { - locale = .Spanish(.Honduras) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_HN") - } - - func test__language_identifier_for_Spanish_Mexico() { - locale = .Spanish(.Mexico) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_MX") - } - - func test__language_identifier_for_Spanish_Uruguay() { - locale = .Spanish(.Uruguay) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_UY") - } - - func test__language_identifier_for_Spanish_CeutaMelilla() { - locale = .Spanish(.CeutaMelilla) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_EA") - } - - func test__language_identifier_for_Spanish_UnitedStates() { - locale = .Spanish(.UnitedStates) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_US") - } - - func test__language_identifier_for_Spanish_ElSalvador() { - locale = .Spanish(.ElSalvador) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_SV") - } - - func test__language_identifier_for_Spanish_Argentina() { - locale = .Spanish(.Argentina) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_AR") - } - - func test__language_identifier_for_Spanish_Ecuador() { - locale = .Spanish(.Ecuador) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_EC") - } - - func test__language_identifier_for_Spanish_EquatorialGuinea() { - locale = .Spanish(.EquatorialGuinea) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_GQ") - } - - func test__language_identifier_for_Spanish_Guatemala() { - locale = .Spanish(.Guatemala) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_GT") - } - - func test__language_identifier_for_Spanish_Cuba() { - locale = .Spanish(.Cuba) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_CU") - } - - func test__language_identifier_for_Spanish_DominicanRepublic() { - locale = .Spanish(.DominicanRepublic) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_DO") - } - - func test__language_identifier_for_Spanish_CostaRica() { - locale = .Spanish(.CostaRica) - XCTAssertEqual(locale.languageIdentifier, "es") - XCTAssertEqual(locale.localeIdentifier, "es_CR") - } -} - -class MNYLocaleSwahiliLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Swahili_CongoKinshasa() { - locale = .Swahili(.CongoKinshasa) - XCTAssertEqual(locale.languageIdentifier, "sw") - XCTAssertEqual(locale.localeIdentifier, "sw_CD") - } - - func test__language_identifier_for_Swahili_Tanzania() { - locale = .Swahili(.Tanzania) - XCTAssertEqual(locale.languageIdentifier, "sw") - XCTAssertEqual(locale.localeIdentifier, "sw_TZ") - } - - func test__language_identifier_for_Swahili_Kenya() { - locale = .Swahili(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "sw") - XCTAssertEqual(locale.localeIdentifier, "sw_KE") - } - - func test__language_identifier_for_Swahili_Uganda() { - locale = .Swahili(.Uganda) - XCTAssertEqual(locale.languageIdentifier, "sw") - XCTAssertEqual(locale.localeIdentifier, "sw_UG") - } -} - -class MNYLocaleSwedishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Swedish_Sweden() { - locale = .Swedish(.Sweden) - XCTAssertEqual(locale.languageIdentifier, "sv") - XCTAssertEqual(locale.localeIdentifier, "sv_SE") - } - - func test__language_identifier_for_Swedish_ÅlandIslands() { - locale = .Swedish(.ÅlandIslands) - XCTAssertEqual(locale.languageIdentifier, "sv") - XCTAssertEqual(locale.localeIdentifier, "sv_AX") - } - - func test__language_identifier_for_Swedish_Finland() { - locale = .Swedish(.Finland) - XCTAssertEqual(locale.languageIdentifier, "sv") - XCTAssertEqual(locale.localeIdentifier, "sv_FI") - } -} - -class MNYLocaleSwissGermanLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_SwissGerman_Switzerland() { - locale = .SwissGerman(.Switzerland) - XCTAssertEqual(locale.languageIdentifier, "gsw") - XCTAssertEqual(locale.localeIdentifier, "gsw_CH") - } - - func test__language_identifier_for_SwissGerman_France() { - locale = .SwissGerman(.France) - XCTAssertEqual(locale.languageIdentifier, "gsw") - XCTAssertEqual(locale.localeIdentifier, "gsw_FR") - } - - func test__language_identifier_for_SwissGerman_Liechtenstein() { - locale = .SwissGerman(.Liechtenstein) - XCTAssertEqual(locale.languageIdentifier, "gsw") - XCTAssertEqual(locale.localeIdentifier, "gsw_LI") - } -} - -class MNYLocaleTamilLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Tamil_India() { - locale = .Tamil(.India) - XCTAssertEqual(locale.languageIdentifier, "ta") - XCTAssertEqual(locale.localeIdentifier, "ta_IN") - } - - func test__language_identifier_for_Tamil_Singapore() { - locale = .Tamil(.Singapore) - XCTAssertEqual(locale.languageIdentifier, "ta") - XCTAssertEqual(locale.localeIdentifier, "ta_SG") - } - - func test__language_identifier_for_Tamil_Malaysia() { - locale = .Tamil(.Malaysia) - XCTAssertEqual(locale.languageIdentifier, "ta") - XCTAssertEqual(locale.localeIdentifier, "ta_MY") - } - - func test__language_identifier_for_Tamil_SriLanka() { - locale = .Tamil(.SriLanka) - XCTAssertEqual(locale.languageIdentifier, "ta") - XCTAssertEqual(locale.localeIdentifier, "ta_LK") - } -} - -class MNYLocaleTesoLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Teso_Kenya() { - locale = .Teso(.Kenya) - XCTAssertEqual(locale.languageIdentifier, "teo") - XCTAssertEqual(locale.localeIdentifier, "teo_KE") - } - - func test__language_identifier_for_Teso_Uganda() { - locale = .Teso(.Uganda) - XCTAssertEqual(locale.languageIdentifier, "teo") - XCTAssertEqual(locale.localeIdentifier, "teo_UG") - } -} - -class MNYLocaleTibetanLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Tibetan_India() { - locale = .Tibetan(.India) - XCTAssertEqual(locale.languageIdentifier, "bo") - XCTAssertEqual(locale.localeIdentifier, "bo_IN") - } - - func test__language_identifier_for_Tibetan_China() { - locale = .Tibetan(.China) - XCTAssertEqual(locale.languageIdentifier, "bo") - XCTAssertEqual(locale.localeIdentifier, "bo_CN") - } -} - -class MNYLocaleTigrinyaLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Tigrinya_Ethiopia() { - locale = .Tigrinya(.Ethiopia) - XCTAssertEqual(locale.languageIdentifier, "ti") - XCTAssertEqual(locale.localeIdentifier, "ti_ET") - } - - func test__language_identifier_for_Tigrinya_Eritrea() { - locale = .Tigrinya(.Eritrea) - XCTAssertEqual(locale.languageIdentifier, "ti") - XCTAssertEqual(locale.localeIdentifier, "ti_ER") - } -} - -class MNYLocaleTurkishLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Turkish_Cyprus() { - locale = .Turkish(.Cyprus) - XCTAssertEqual(locale.languageIdentifier, "tr") - XCTAssertEqual(locale.localeIdentifier, "tr_CY") - } - - func test__language_identifier_for_Turkish_Turkey() { - locale = .Turkish(.Turkey) - XCTAssertEqual(locale.languageIdentifier, "tr") - XCTAssertEqual(locale.localeIdentifier, "tr_TR") - } -} - -class MNYLocaleUrduLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Urdu_Pakistan() { - locale = .Urdu(.Pakistan) - XCTAssertEqual(locale.languageIdentifier, "ur") - XCTAssertEqual(locale.localeIdentifier, "ur_PK") - } - - func test__language_identifier_for_Urdu_India() { - locale = .Urdu(.India) - XCTAssertEqual(locale.languageIdentifier, "ur") - XCTAssertEqual(locale.localeIdentifier, "ur_IN") - } -} - -class MNYLocaleUzbekLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Uzbek_Uzbekistan() { - locale = .Uzbek(.Uzbekistan) - XCTAssertEqual(locale.languageIdentifier, "uz") - XCTAssertEqual(locale.localeIdentifier, "uz_UZ") - } - - func test__language_identifier_for_Uzbek_Afghanistan() { - locale = .Uzbek(.Afghanistan) - XCTAssertEqual(locale.languageIdentifier, "uz") - XCTAssertEqual(locale.localeIdentifier, "uz_AF") - } -} - -class MNYLocaleYorubaLanguageAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Yoruba_Benin() { - locale = .Yoruba(.Benin) - XCTAssertEqual(locale.languageIdentifier, "yo") - XCTAssertEqual(locale.localeIdentifier, "yo_BJ") - } - - func test__language_identifier_for_Yoruba_Nigeria() { - locale = .Yoruba(.Nigeria) - XCTAssertEqual(locale.languageIdentifier, "yo") - XCTAssertEqual(locale.localeIdentifier, "yo_NG") - } -} - -class MNYLocaleAutogeneratedTests: XCTestCase { - - var locale: MNYLocale! - - func test__language_identifier_for_Aghem() { - locale = .Aghem - XCTAssertEqual(locale.languageIdentifier, "agq") - XCTAssertEqual(locale.localeIdentifier, "agq") - } - - func test__language_identifier_for_Akan() { - locale = .Akan - XCTAssertEqual(locale.languageIdentifier, "ak") - XCTAssertEqual(locale.localeIdentifier, "ak") - } - - func test__language_identifier_for_Amharic() { - locale = .Amharic - XCTAssertEqual(locale.languageIdentifier, "am") - XCTAssertEqual(locale.localeIdentifier, "am") - } - - func test__language_identifier_for_Armenian() { - locale = .Armenian - XCTAssertEqual(locale.languageIdentifier, "hy") - XCTAssertEqual(locale.localeIdentifier, "hy") - } - - func test__language_identifier_for_Assamese() { - locale = .Assamese - XCTAssertEqual(locale.languageIdentifier, "as") - XCTAssertEqual(locale.localeIdentifier, "as") - } - - func test__language_identifier_for_Asturian() { - locale = .Asturian - XCTAssertEqual(locale.languageIdentifier, "ast") - XCTAssertEqual(locale.localeIdentifier, "ast") - } - - func test__language_identifier_for_Asu() { - locale = .Asu - XCTAssertEqual(locale.languageIdentifier, "asa") - XCTAssertEqual(locale.localeIdentifier, "asa") - } - - func test__language_identifier_for_Azerbaijani() { - locale = .Azerbaijani - XCTAssertEqual(locale.languageIdentifier, "az") - XCTAssertEqual(locale.localeIdentifier, "az") - } - - func test__language_identifier_for_Bafia() { - locale = .Bafia - XCTAssertEqual(locale.languageIdentifier, "ksf") - XCTAssertEqual(locale.localeIdentifier, "ksf") - } - - func test__language_identifier_for_Bambara() { - locale = .Bambara - XCTAssertEqual(locale.languageIdentifier, "bm") - XCTAssertEqual(locale.localeIdentifier, "bm") - } - - func test__language_identifier_for_Basaa() { - locale = .Basaa - XCTAssertEqual(locale.languageIdentifier, "bas") - XCTAssertEqual(locale.localeIdentifier, "bas") - } - - func test__language_identifier_for_Basque() { - locale = .Basque - XCTAssertEqual(locale.languageIdentifier, "eu") - XCTAssertEqual(locale.localeIdentifier, "eu") - } - - func test__language_identifier_for_Belarusian() { - locale = .Belarusian - XCTAssertEqual(locale.languageIdentifier, "be") - XCTAssertEqual(locale.localeIdentifier, "be") - } - - func test__language_identifier_for_Bemba() { - locale = .Bemba - XCTAssertEqual(locale.languageIdentifier, "bem") - XCTAssertEqual(locale.localeIdentifier, "bem") - } - - func test__language_identifier_for_Bena() { - locale = .Bena - XCTAssertEqual(locale.languageIdentifier, "bez") - XCTAssertEqual(locale.localeIdentifier, "bez") - } - - func test__language_identifier_for_Bodo() { - locale = .Bodo - XCTAssertEqual(locale.languageIdentifier, "brx") - XCTAssertEqual(locale.localeIdentifier, "brx") - } - - func test__language_identifier_for_Bosnian() { - locale = .Bosnian - XCTAssertEqual(locale.languageIdentifier, "bs") - XCTAssertEqual(locale.localeIdentifier, "bs") - } - - func test__language_identifier_for_Breton() { - locale = .Breton - XCTAssertEqual(locale.languageIdentifier, "br") - XCTAssertEqual(locale.localeIdentifier, "br") - } - - func test__language_identifier_for_Bulgarian() { - locale = .Bulgarian - XCTAssertEqual(locale.languageIdentifier, "bg") - XCTAssertEqual(locale.localeIdentifier, "bg") - } - - func test__language_identifier_for_Burmese() { - locale = .Burmese - XCTAssertEqual(locale.languageIdentifier, "my") - XCTAssertEqual(locale.localeIdentifier, "my") - } - - func test__language_identifier_for_Cantonese() { - locale = .Cantonese - XCTAssertEqual(locale.languageIdentifier, "yue") - XCTAssertEqual(locale.localeIdentifier, "yue") - } - - func test__language_identifier_for_CentralAtlasTamazight() { - locale = .CentralAtlasTamazight - XCTAssertEqual(locale.languageIdentifier, "tzm") - XCTAssertEqual(locale.localeIdentifier, "tzm") - } - - func test__language_identifier_for_Chechen() { - locale = .Chechen - XCTAssertEqual(locale.languageIdentifier, "ce") - XCTAssertEqual(locale.localeIdentifier, "ce") - } - - func test__language_identifier_for_Cherokee() { - locale = .Cherokee - XCTAssertEqual(locale.languageIdentifier, "chr") - XCTAssertEqual(locale.localeIdentifier, "chr") - } - - func test__language_identifier_for_Chiga() { - locale = .Chiga - XCTAssertEqual(locale.languageIdentifier, "cgg") - XCTAssertEqual(locale.localeIdentifier, "cgg") - } - - func test__language_identifier_for_Colognian() { - locale = .Colognian - XCTAssertEqual(locale.languageIdentifier, "ksh") - XCTAssertEqual(locale.localeIdentifier, "ksh") - } - - func test__language_identifier_for_Cornish() { - locale = .Cornish - XCTAssertEqual(locale.languageIdentifier, "kw") - XCTAssertEqual(locale.localeIdentifier, "kw") - } - - func test__language_identifier_for_Czech() { - locale = .Czech - XCTAssertEqual(locale.languageIdentifier, "cs") - XCTAssertEqual(locale.localeIdentifier, "cs") - } - - func test__language_identifier_for_Duala() { - locale = .Duala - XCTAssertEqual(locale.languageIdentifier, "dua") - XCTAssertEqual(locale.localeIdentifier, "dua") - } - - func test__language_identifier_for_Dzongkha() { - locale = .Dzongkha - XCTAssertEqual(locale.languageIdentifier, "dz") - XCTAssertEqual(locale.localeIdentifier, "dz") - } - - func test__language_identifier_for_Embu() { - locale = .Embu - XCTAssertEqual(locale.languageIdentifier, "ebu") - XCTAssertEqual(locale.localeIdentifier, "ebu") - } - - func test__language_identifier_for_Estonian() { - locale = .Estonian - XCTAssertEqual(locale.languageIdentifier, "et") - XCTAssertEqual(locale.localeIdentifier, "et") - } - - func test__language_identifier_for_Ewondo() { - locale = .Ewondo - XCTAssertEqual(locale.languageIdentifier, "ewo") - XCTAssertEqual(locale.localeIdentifier, "ewo") - } - - func test__language_identifier_for_Filipino() { - locale = .Filipino - XCTAssertEqual(locale.languageIdentifier, "fil") - XCTAssertEqual(locale.localeIdentifier, "fil") - } - - func test__language_identifier_for_Finnish() { - locale = .Finnish - XCTAssertEqual(locale.languageIdentifier, "fi") - XCTAssertEqual(locale.localeIdentifier, "fi") - } - - func test__language_identifier_for_Friulian() { - locale = .Friulian - XCTAssertEqual(locale.languageIdentifier, "fur") - XCTAssertEqual(locale.localeIdentifier, "fur") - } - - func test__language_identifier_for_Galician() { - locale = .Galician - XCTAssertEqual(locale.languageIdentifier, "gl") - XCTAssertEqual(locale.localeIdentifier, "gl") - } - - func test__language_identifier_for_Ganda() { - locale = .Ganda - XCTAssertEqual(locale.languageIdentifier, "lg") - XCTAssertEqual(locale.localeIdentifier, "lg") - } - - func test__language_identifier_for_Georgian() { - locale = .Georgian - XCTAssertEqual(locale.languageIdentifier, "ka") - XCTAssertEqual(locale.localeIdentifier, "ka") - } - - func test__language_identifier_for_Gujarati() { - locale = .Gujarati - XCTAssertEqual(locale.languageIdentifier, "gu") - XCTAssertEqual(locale.localeIdentifier, "gu") - } - - func test__language_identifier_for_Gusii() { - locale = .Gusii - XCTAssertEqual(locale.languageIdentifier, "guz") - XCTAssertEqual(locale.localeIdentifier, "guz") - } - - func test__language_identifier_for_Hawaiian() { - locale = .Hawaiian - XCTAssertEqual(locale.languageIdentifier, "haw") - XCTAssertEqual(locale.localeIdentifier, "haw") - } - - func test__language_identifier_for_Hebrew() { - locale = .Hebrew - XCTAssertEqual(locale.languageIdentifier, "he") - XCTAssertEqual(locale.localeIdentifier, "he") - } - - func test__language_identifier_for_Hindi() { - locale = .Hindi - XCTAssertEqual(locale.languageIdentifier, "hi") - XCTAssertEqual(locale.localeIdentifier, "hi") - } - - func test__language_identifier_for_Hungarian() { - locale = .Hungarian - XCTAssertEqual(locale.languageIdentifier, "hu") - XCTAssertEqual(locale.localeIdentifier, "hu") - } - - func test__language_identifier_for_Icelandic() { - locale = .Icelandic - XCTAssertEqual(locale.languageIdentifier, "is") - XCTAssertEqual(locale.localeIdentifier, "is") - } - - func test__language_identifier_for_Igbo() { - locale = .Igbo - XCTAssertEqual(locale.languageIdentifier, "ig") - XCTAssertEqual(locale.localeIdentifier, "ig") - } - - func test__language_identifier_for_InariSami() { - locale = .InariSami - XCTAssertEqual(locale.languageIdentifier, "smn") - XCTAssertEqual(locale.localeIdentifier, "smn") - } - - func test__language_identifier_for_Indonesian() { - locale = .Indonesian - XCTAssertEqual(locale.languageIdentifier, "id") - XCTAssertEqual(locale.localeIdentifier, "id") - } - - func test__language_identifier_for_Inuktitut() { - locale = .Inuktitut - XCTAssertEqual(locale.languageIdentifier, "iu") - XCTAssertEqual(locale.localeIdentifier, "iu") - } - - func test__language_identifier_for_Irish() { - locale = .Irish - XCTAssertEqual(locale.languageIdentifier, "ga") - XCTAssertEqual(locale.localeIdentifier, "ga") - } - - func test__language_identifier_for_Japanese() { - locale = .Japanese - XCTAssertEqual(locale.languageIdentifier, "ja") - XCTAssertEqual(locale.localeIdentifier, "ja") - } - - func test__language_identifier_for_JolaFonyi() { - locale = .JolaFonyi - XCTAssertEqual(locale.languageIdentifier, "dyo") - XCTAssertEqual(locale.localeIdentifier, "dyo") - } - - func test__language_identifier_for_Kabuverdianu() { - locale = .Kabuverdianu - XCTAssertEqual(locale.languageIdentifier, "kea") - XCTAssertEqual(locale.localeIdentifier, "kea") - } - - func test__language_identifier_for_Kabyle() { - locale = .Kabyle - XCTAssertEqual(locale.languageIdentifier, "kab") - XCTAssertEqual(locale.localeIdentifier, "kab") - } - - func test__language_identifier_for_Kako() { - locale = .Kako - XCTAssertEqual(locale.languageIdentifier, "kkj") - XCTAssertEqual(locale.localeIdentifier, "kkj") - } - - func test__language_identifier_for_Kalaallisut() { - locale = .Kalaallisut - XCTAssertEqual(locale.languageIdentifier, "kl") - XCTAssertEqual(locale.localeIdentifier, "kl") - } - - func test__language_identifier_for_Kalenjin() { - locale = .Kalenjin - XCTAssertEqual(locale.languageIdentifier, "kln") - XCTAssertEqual(locale.localeIdentifier, "kln") - } - - func test__language_identifier_for_Kamba() { - locale = .Kamba - XCTAssertEqual(locale.languageIdentifier, "kam") - XCTAssertEqual(locale.localeIdentifier, "kam") - } - - func test__language_identifier_for_Kannada() { - locale = .Kannada - XCTAssertEqual(locale.languageIdentifier, "kn") - XCTAssertEqual(locale.localeIdentifier, "kn") - } - - func test__language_identifier_for_Kashmiri() { - locale = .Kashmiri - XCTAssertEqual(locale.languageIdentifier, "ks") - XCTAssertEqual(locale.localeIdentifier, "ks") - } - - func test__language_identifier_for_Kazakh() { - locale = .Kazakh - XCTAssertEqual(locale.languageIdentifier, "kk") - XCTAssertEqual(locale.localeIdentifier, "kk") - } - - func test__language_identifier_for_Khmer() { - locale = .Khmer - XCTAssertEqual(locale.languageIdentifier, "km") - XCTAssertEqual(locale.localeIdentifier, "km") - } - - func test__language_identifier_for_Kikuyu() { - locale = .Kikuyu - XCTAssertEqual(locale.languageIdentifier, "ki") - XCTAssertEqual(locale.localeIdentifier, "ki") - } - - func test__language_identifier_for_Kinyarwanda() { - locale = .Kinyarwanda - XCTAssertEqual(locale.languageIdentifier, "rw") - XCTAssertEqual(locale.localeIdentifier, "rw") - } - - func test__language_identifier_for_Konkani() { - locale = .Konkani - XCTAssertEqual(locale.languageIdentifier, "kok") - XCTAssertEqual(locale.localeIdentifier, "kok") - } - - func test__language_identifier_for_KoyraChiini() { - locale = .KoyraChiini - XCTAssertEqual(locale.languageIdentifier, "khq") - XCTAssertEqual(locale.localeIdentifier, "khq") - } - - func test__language_identifier_for_KoyraboroSenni() { - locale = .KoyraboroSenni - XCTAssertEqual(locale.languageIdentifier, "ses") - XCTAssertEqual(locale.localeIdentifier, "ses") - } - - func test__language_identifier_for_Kwasio() { - locale = .Kwasio - XCTAssertEqual(locale.languageIdentifier, "nmg") - XCTAssertEqual(locale.localeIdentifier, "nmg") - } - - func test__language_identifier_for_Kyrgyz() { - locale = .Kyrgyz - XCTAssertEqual(locale.languageIdentifier, "ky") - XCTAssertEqual(locale.localeIdentifier, "ky") - } - - func test__language_identifier_for_Lakota() { - locale = .Lakota - XCTAssertEqual(locale.languageIdentifier, "lkt") - XCTAssertEqual(locale.localeIdentifier, "lkt") - } - - func test__language_identifier_for_Langi() { - locale = .Langi - XCTAssertEqual(locale.languageIdentifier, "lag") - XCTAssertEqual(locale.localeIdentifier, "lag") - } - - func test__language_identifier_for_Lao() { - locale = .Lao - XCTAssertEqual(locale.languageIdentifier, "lo") - XCTAssertEqual(locale.localeIdentifier, "lo") - } - - func test__language_identifier_for_Latvian() { - locale = .Latvian - XCTAssertEqual(locale.languageIdentifier, "lv") - XCTAssertEqual(locale.localeIdentifier, "lv") - } - - func test__language_identifier_for_Lithuanian() { - locale = .Lithuanian - XCTAssertEqual(locale.languageIdentifier, "lt") - XCTAssertEqual(locale.localeIdentifier, "lt") - } - - func test__language_identifier_for_LowerSorbian() { - locale = .LowerSorbian - XCTAssertEqual(locale.languageIdentifier, "dsb") - XCTAssertEqual(locale.localeIdentifier, "dsb") - } - - func test__language_identifier_for_LubaKatanga() { - locale = .LubaKatanga - XCTAssertEqual(locale.languageIdentifier, "lu") - XCTAssertEqual(locale.localeIdentifier, "lu") - } - - func test__language_identifier_for_Luo() { - locale = .Luo - XCTAssertEqual(locale.languageIdentifier, "luo") - XCTAssertEqual(locale.localeIdentifier, "luo") - } - - func test__language_identifier_for_Luxembourgish() { - locale = .Luxembourgish - XCTAssertEqual(locale.languageIdentifier, "lb") - XCTAssertEqual(locale.localeIdentifier, "lb") - } - - func test__language_identifier_for_Luyia() { - locale = .Luyia - XCTAssertEqual(locale.languageIdentifier, "luy") - XCTAssertEqual(locale.localeIdentifier, "luy") - } - - func test__language_identifier_for_Macedonian() { - locale = .Macedonian - XCTAssertEqual(locale.languageIdentifier, "mk") - XCTAssertEqual(locale.localeIdentifier, "mk") - } - - func test__language_identifier_for_Machame() { - locale = .Machame - XCTAssertEqual(locale.languageIdentifier, "jmc") - XCTAssertEqual(locale.localeIdentifier, "jmc") - } - - func test__language_identifier_for_MakhuwaMeetto() { - locale = .MakhuwaMeetto - XCTAssertEqual(locale.languageIdentifier, "mgh") - XCTAssertEqual(locale.localeIdentifier, "mgh") - } - - func test__language_identifier_for_Makonde() { - locale = .Makonde - XCTAssertEqual(locale.languageIdentifier, "kde") - XCTAssertEqual(locale.localeIdentifier, "kde") - } - - func test__language_identifier_for_Malagasy() { - locale = .Malagasy - XCTAssertEqual(locale.languageIdentifier, "mg") - XCTAssertEqual(locale.localeIdentifier, "mg") - } - - func test__language_identifier_for_Malayalam() { - locale = .Malayalam - XCTAssertEqual(locale.languageIdentifier, "ml") - XCTAssertEqual(locale.localeIdentifier, "ml") - } - - func test__language_identifier_for_Maltese() { - locale = .Maltese - XCTAssertEqual(locale.languageIdentifier, "mt") - XCTAssertEqual(locale.localeIdentifier, "mt") - } - - func test__language_identifier_for_Manx() { - locale = .Manx - XCTAssertEqual(locale.languageIdentifier, "gv") - XCTAssertEqual(locale.localeIdentifier, "gv") - } - - func test__language_identifier_for_Marathi() { - locale = .Marathi - XCTAssertEqual(locale.languageIdentifier, "mr") - XCTAssertEqual(locale.localeIdentifier, "mr") - } - - func test__language_identifier_for_Mazanderani() { - locale = .Mazanderani - XCTAssertEqual(locale.languageIdentifier, "mzn") - XCTAssertEqual(locale.localeIdentifier, "mzn") - } - - func test__language_identifier_for_Meru() { - locale = .Meru - XCTAssertEqual(locale.languageIdentifier, "mer") - XCTAssertEqual(locale.localeIdentifier, "mer") - } - - func test__language_identifier_for_Meta() { - locale = .Meta - XCTAssertEqual(locale.languageIdentifier, "mgo") - XCTAssertEqual(locale.localeIdentifier, "mgo") - } - - func test__language_identifier_for_Mongolian() { - locale = .Mongolian - XCTAssertEqual(locale.languageIdentifier, "mn") - XCTAssertEqual(locale.localeIdentifier, "mn") - } - - func test__language_identifier_for_Morisyen() { - locale = .Morisyen - XCTAssertEqual(locale.languageIdentifier, "mfe") - XCTAssertEqual(locale.localeIdentifier, "mfe") - } - - func test__language_identifier_for_Mundang() { - locale = .Mundang - XCTAssertEqual(locale.languageIdentifier, "mua") - XCTAssertEqual(locale.localeIdentifier, "mua") - } - - func test__language_identifier_for_Nama() { - locale = .Nama - XCTAssertEqual(locale.languageIdentifier, "naq") - XCTAssertEqual(locale.localeIdentifier, "naq") - } - - func test__language_identifier_for_Ngiemboon() { - locale = .Ngiemboon - XCTAssertEqual(locale.languageIdentifier, "nnh") - XCTAssertEqual(locale.localeIdentifier, "nnh") - } - - func test__language_identifier_for_Ngomba() { - locale = .Ngomba - XCTAssertEqual(locale.languageIdentifier, "jgo") - XCTAssertEqual(locale.localeIdentifier, "jgo") - } - - func test__language_identifier_for_NorthNdebele() { - locale = .NorthNdebele - XCTAssertEqual(locale.languageIdentifier, "nd") - XCTAssertEqual(locale.localeIdentifier, "nd") - } - - func test__language_identifier_for_NorwegianNynorsk() { - locale = .NorwegianNynorsk - XCTAssertEqual(locale.languageIdentifier, "nn") - XCTAssertEqual(locale.localeIdentifier, "nn") - } - - func test__language_identifier_for_Nuer() { - locale = .Nuer - XCTAssertEqual(locale.languageIdentifier, "nus") - XCTAssertEqual(locale.localeIdentifier, "nus") - } - - func test__language_identifier_for_Nyankole() { - locale = .Nyankole - XCTAssertEqual(locale.languageIdentifier, "nyn") - XCTAssertEqual(locale.localeIdentifier, "nyn") - } - - func test__language_identifier_for_Oriya() { - locale = .Oriya - XCTAssertEqual(locale.languageIdentifier, "or") - XCTAssertEqual(locale.localeIdentifier, "or") - } - - func test__language_identifier_for_Pashto() { - locale = .Pashto - XCTAssertEqual(locale.languageIdentifier, "ps") - XCTAssertEqual(locale.localeIdentifier, "ps") - } - - func test__language_identifier_for_Polish() { - locale = .Polish - XCTAssertEqual(locale.languageIdentifier, "pl") - XCTAssertEqual(locale.localeIdentifier, "pl") - } - - func test__language_identifier_for_Romansh() { - locale = .Romansh - XCTAssertEqual(locale.languageIdentifier, "rm") - XCTAssertEqual(locale.localeIdentifier, "rm") - } - - func test__language_identifier_for_Rombo() { - locale = .Rombo - XCTAssertEqual(locale.languageIdentifier, "rof") - XCTAssertEqual(locale.localeIdentifier, "rof") - } - - func test__language_identifier_for_Rundi() { - locale = .Rundi - XCTAssertEqual(locale.languageIdentifier, "rn") - XCTAssertEqual(locale.localeIdentifier, "rn") - } - - func test__language_identifier_for_Rwa() { - locale = .Rwa - XCTAssertEqual(locale.languageIdentifier, "rwk") - XCTAssertEqual(locale.localeIdentifier, "rwk") - } - - func test__language_identifier_for_Sakha() { - locale = .Sakha - XCTAssertEqual(locale.languageIdentifier, "sah") - XCTAssertEqual(locale.localeIdentifier, "sah") - } - - func test__language_identifier_for_Samburu() { - locale = .Samburu - XCTAssertEqual(locale.languageIdentifier, "saq") - XCTAssertEqual(locale.localeIdentifier, "saq") - } - - func test__language_identifier_for_Sango() { - locale = .Sango - XCTAssertEqual(locale.languageIdentifier, "sg") - XCTAssertEqual(locale.localeIdentifier, "sg") - } - - func test__language_identifier_for_Sangu() { - locale = .Sangu - XCTAssertEqual(locale.languageIdentifier, "sbp") - XCTAssertEqual(locale.localeIdentifier, "sbp") - } - - func test__language_identifier_for_ScottishGaelic() { - locale = .ScottishGaelic - XCTAssertEqual(locale.languageIdentifier, "gd") - XCTAssertEqual(locale.localeIdentifier, "gd") - } - - func test__language_identifier_for_Sena() { - locale = .Sena - XCTAssertEqual(locale.languageIdentifier, "seh") - XCTAssertEqual(locale.localeIdentifier, "seh") - } - - func test__language_identifier_for_Shambala() { - locale = .Shambala - XCTAssertEqual(locale.languageIdentifier, "ksb") - XCTAssertEqual(locale.localeIdentifier, "ksb") - } - - func test__language_identifier_for_Shona() { - locale = .Shona - XCTAssertEqual(locale.languageIdentifier, "sn") - XCTAssertEqual(locale.localeIdentifier, "sn") - } - - func test__language_identifier_for_SichuanYi() { - locale = .SichuanYi - XCTAssertEqual(locale.languageIdentifier, "ii") - XCTAssertEqual(locale.localeIdentifier, "ii") - } - - func test__language_identifier_for_Sinhala() { - locale = .Sinhala - XCTAssertEqual(locale.languageIdentifier, "si") - XCTAssertEqual(locale.localeIdentifier, "si") - } - - func test__language_identifier_for_Slovak() { - locale = .Slovak - XCTAssertEqual(locale.languageIdentifier, "sk") - XCTAssertEqual(locale.localeIdentifier, "sk") - } - - func test__language_identifier_for_Slovenian() { - locale = .Slovenian - XCTAssertEqual(locale.languageIdentifier, "sl") - XCTAssertEqual(locale.localeIdentifier, "sl") - } - - func test__language_identifier_for_Soga() { - locale = .Soga - XCTAssertEqual(locale.languageIdentifier, "xog") - XCTAssertEqual(locale.localeIdentifier, "xog") - } - - func test__language_identifier_for_StandardMoroccanTamazight() { - locale = .StandardMoroccanTamazight - XCTAssertEqual(locale.languageIdentifier, "zgh") - XCTAssertEqual(locale.localeIdentifier, "zgh") - } - - func test__language_identifier_for_Tachelhit() { - locale = .Tachelhit - XCTAssertEqual(locale.languageIdentifier, "shi") - XCTAssertEqual(locale.localeIdentifier, "shi") - } - - func test__language_identifier_for_Taita() { - locale = .Taita - XCTAssertEqual(locale.languageIdentifier, "dav") - XCTAssertEqual(locale.localeIdentifier, "dav") - } - - func test__language_identifier_for_Tajik() { - locale = .Tajik - XCTAssertEqual(locale.languageIdentifier, "tg") - XCTAssertEqual(locale.localeIdentifier, "tg") - } - - func test__language_identifier_for_Tasawaq() { - locale = .Tasawaq - XCTAssertEqual(locale.languageIdentifier, "twq") - XCTAssertEqual(locale.localeIdentifier, "twq") - } - - func test__language_identifier_for_Telugu() { - locale = .Telugu - XCTAssertEqual(locale.languageIdentifier, "te") - XCTAssertEqual(locale.localeIdentifier, "te") - } - - func test__language_identifier_for_Thai() { - locale = .Thai - XCTAssertEqual(locale.languageIdentifier, "th") - XCTAssertEqual(locale.localeIdentifier, "th") - } - - func test__language_identifier_for_Tongan() { - locale = .Tongan - XCTAssertEqual(locale.languageIdentifier, "to") - XCTAssertEqual(locale.localeIdentifier, "to") - } - - func test__language_identifier_for_Turkmen() { - locale = .Turkmen - XCTAssertEqual(locale.languageIdentifier, "tk") - XCTAssertEqual(locale.localeIdentifier, "tk") - } - - func test__language_identifier_for_Ukrainian() { - locale = .Ukrainian - XCTAssertEqual(locale.languageIdentifier, "uk") - XCTAssertEqual(locale.localeIdentifier, "uk") - } - - func test__language_identifier_for_UpperSorbian() { - locale = .UpperSorbian - XCTAssertEqual(locale.languageIdentifier, "hsb") - XCTAssertEqual(locale.localeIdentifier, "hsb") - } - - func test__language_identifier_for_Uyghur() { - locale = .Uyghur - XCTAssertEqual(locale.languageIdentifier, "ug") - XCTAssertEqual(locale.localeIdentifier, "ug") - } - - func test__language_identifier_for_Vai() { - locale = .Vai - XCTAssertEqual(locale.languageIdentifier, "vai") - XCTAssertEqual(locale.localeIdentifier, "vai") - } - - func test__language_identifier_for_Vietnamese() { - locale = .Vietnamese - XCTAssertEqual(locale.languageIdentifier, "vi") - XCTAssertEqual(locale.localeIdentifier, "vi") - } - - func test__language_identifier_for_Vunjo() { - locale = .Vunjo - XCTAssertEqual(locale.languageIdentifier, "vun") - XCTAssertEqual(locale.localeIdentifier, "vun") - } - - func test__language_identifier_for_Walser() { - locale = .Walser - XCTAssertEqual(locale.languageIdentifier, "wae") - XCTAssertEqual(locale.localeIdentifier, "wae") - } - - func test__language_identifier_for_Welsh() { - locale = .Welsh - XCTAssertEqual(locale.languageIdentifier, "cy") - XCTAssertEqual(locale.localeIdentifier, "cy") - } - - func test__language_identifier_for_WesternFrisian() { - locale = .WesternFrisian - XCTAssertEqual(locale.languageIdentifier, "fy") - XCTAssertEqual(locale.localeIdentifier, "fy") - } - - func test__language_identifier_for_Yangben() { - locale = .Yangben - XCTAssertEqual(locale.languageIdentifier, "yav") - XCTAssertEqual(locale.localeIdentifier, "yav") - } - - func test__language_identifier_for_Yiddish() { - locale = .Yiddish - XCTAssertEqual(locale.languageIdentifier, "yi") - XCTAssertEqual(locale.localeIdentifier, "yi") - } - - func test__language_identifier_for_Zarma() { - locale = .Zarma - XCTAssertEqual(locale.languageIdentifier, "dje") - XCTAssertEqual(locale.localeIdentifier, "dje") - } - - func test__language_identifier_for_Zulu() { - locale = .Zulu - XCTAssertEqual(locale.languageIdentifier, "zu") - XCTAssertEqual(locale.localeIdentifier, "zu") - } -} diff --git a/Tests/BitcoinTests.swift b/Tests/BitcoinTests.swift deleted file mode 100644 index e858def..0000000 --- a/Tests/BitcoinTests.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - - -class BitcoinCurrencyTests: XCTestCase { - - func test__xbt_currency_code() { - XCTAssertEqual(Currency.XBT.code, "XBT") - } - - func test__btc_currency_code() { - XCTAssertEqual(Currency.BTC.code, "BTC") - } - - func test__btc_currency_symbol() { - XCTAssertEqual(Currency.BTC.symbol, "Ƀ") - } - - func test__btc_currency_scale() { - XCTAssertEqual(Currency.BTC.scale, 8) - } -} - diff --git a/Tests/ComparisonTests.swift b/Tests/ComparisonTests.swift new file mode 100644 index 0000000..1a01e98 --- /dev/null +++ b/Tests/ComparisonTests.swift @@ -0,0 +1,39 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__less_than() { + money = 10 + XCTAssertLessThan(money, 11) + } + + func test__greater_than() { + money = 10 + XCTAssertGreaterThan(money, 9) + } +} + +extension MoneyTestCase { + + func test__iso_less_than() { + gbp = 10 + XCTAssertLessThan(gbp, 11) + } + + func test__iso_greater_than() { + gbp = 10 + XCTAssertGreaterThan(gbp, 9) + } +} diff --git a/Tests/DecimalNumberTypeTests.swift b/Tests/DecimalNumberTypeTests.swift deleted file mode 100644 index f2ca364..0000000 --- a/Tests/DecimalNumberTypeTests.swift +++ /dev/null @@ -1,140 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - -class DecimalNumberTypeTests: XCTestCase { - - var decimal: PlainDecimal! - var money: Money! - - func test__init_with_int() { - let value: Int = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_uint8() { - let value: UInt8 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_int8() { - let value: Int8 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_uint16() { - let value: UInt16 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_int16() { - let value: Int16 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_uint32() { - let value: UInt32 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_int32() { - let value: Int32 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_uint64() { - let value: UInt64 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_int64() { - let value: Int64 = 10 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 10) - XCTAssertEqual(money, 10) - } - - func test__init_with_float() { - let value: Float = 9.0 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 9.0) - XCTAssertEqual(money, 9.00) - } - - func test__init_with_double() { - let value: Double = 9.999 - decimal = PlainDecimal(value) - money = Money(value) - XCTAssertEqual(decimal, 9.999) - XCTAssertEqual(money, 10.00) - } - - func testPerformanceInitInt() { - measure { - for value in 1...10_000 { - self.money = Money(value) - } - } - } - - func testPerformanceInitDouble() { - let value: Double = 9.99 - measure { - for _ in 1...10_000 { - self.money = Money(value) - } - } - } - -} diff --git a/Tests/DecimalTests.swift b/Tests/DecimalTests.swift deleted file mode 100644 index 9e6fa93..0000000 --- a/Tests/DecimalTests.swift +++ /dev/null @@ -1,122 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -import ValueCoding -@testable import Money - -class PlainDecimalTestCase: XCTestCase { - var decimal: PlainDecimal! - - override func tearDown() { - decimal = nil - super.tearDown() - } -} - -class DecimalAccessorTests: PlainDecimalTestCase { - - func test__decimal_integer_value() { - decimal = 10.00 - XCTAssertEqual(decimal.integerValue, 10) - } - - func test__decimal_float_value() { - decimal = 10.00 - XCTAssertEqual(decimal.floatValue, 10.0) - } -} - -class DecimalDescriptionTests: PlainDecimalTestCase { - - func test__decimal_decription1() { - decimal = 10.00 - XCTAssertEqual(decimal.description, "10") - } - - func test__decimal_decription2() { - decimal = 10.01 - XCTAssertEqual(decimal.description, "10.01") - } -} - -class DecimalReciprocalTests: PlainDecimalTestCase { - - func test__reciprocal() { - decimal = 10 - XCTAssertEqual(decimal.reciprocal, 0.1) - } - - func test__reciprocal_unity() { - decimal = 1 - XCTAssertEqual(decimal.reciprocal, 1) - } -} - -class DecimalNumberConversionTests: PlainDecimalTestCase { - var money: GBP! - - override func setUp() { - super.setUp() - decimal = 10 - money = 20 - } - - override func tearDown() { - money = nil - super.tearDown() - } - - func test__multiply() { - let result = decimal * money - XCTAssertEqual(result.description, "£200.00") - XCTAssertEqual(money * decimal, 200) - } - - func test__divide() { - let result = decimal / money - XCTAssertEqual(result.description, "£0.50") - XCTAssertEqual(money / decimal, 2) - } -} - -class DecimalValueCodingTests: PlainDecimalTestCase { - - func archiveEncodedDecimal() -> Data { - return NSKeyedArchiver.archivedData(withRootObject: decimal.encoded) - } - - func unarchive(_ archive: Data) -> PlainDecimal? { - return PlainDecimal.decode(NSKeyedUnarchiver.unarchiveObject(with: archive) as AnyObject?) - } - - func test__decimal_encodes() { - decimal = 10 - XCTAssertEqual(unarchive(archiveEncodedDecimal()), decimal) - } -} - - diff --git a/Tests/DivisionTests.swift b/Tests/DivisionTests.swift new file mode 100644 index 0000000..de08824 --- /dev/null +++ b/Tests/DivisionTests.swift @@ -0,0 +1,57 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__money_division() { + money = 10 + let result = money / Money(decimal: Decimal(floatLiteral: 2)) + XCTAssertEqual(result, 5) + } + + func test__money_division_by_integer_literals() { + money = 10 + let result = 3 / money / 2 + XCTAssertEqual(result, 0.15) + } + + func test__money_division_by_float_literals() { + money = 10 + let result = 3.5 / money / 2.5 + XCTAssertEqual(result.floatValue, 0.14, accuracy: 0.001) + } +} + +extension MoneyTestCase { + + func test__iso_division() { + gbp = 10 + let result = gbp / GBP(decimal: Decimal(integerLiteral: 2)) + XCTAssertEqual(result, 5) + } + + func test__iso_division_by_integer_literals() { + gbp = 10 + let result = 3 / gbp / 2 + XCTAssertEqual(result, 0.15) + } + + func test__iso_division_by_float_literals() { + gbp = 10 + let result = 3.5 / gbp / 2.5 + XCTAssertEqual(result.floatValue, 0.14, accuracy: 0.001) + } +} + + diff --git a/Tests/InitTests.swift b/Tests/InitTests.swift new file mode 100644 index 0000000..27de995 --- /dev/null +++ b/Tests/InitTests.swift @@ -0,0 +1,52 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__Given_initialized_with_no_argument__Then_money_is_zero() { + money = Money() + XCTAssertEqual(money, .makeZero()) + XCTAssertEqual(money, 0) + XCTAssertEqual(money.currency.scale, 2) + } + + func test__Given_initialized_with_no_argument__Then_gbp_is_zero() { + gbp = GBP() + XCTAssertEqual(gbp, 0) + } + + func test__Given_initialized_with_one__Then_gbp_is_one() { + gbp = GBP(integerLiteral: 1) + XCTAssertEqual(gbp, 1) + } + + func test__Given_initialized_with_double__Then_gbp_is_one() { + gbp = GBP(floatLiteral: 10.0) + XCTAssertEqual(gbp, 10.0) + } + + func test__Given_initialized_with_minor_units() { + gbp = GBP(minorUnits: 100_000) + XCTAssertEqual(gbp.minorUnits, 100_000) + XCTAssertEqual(gbp.integerValue, 1_000) + } + + func test__local_Given_initialized_with_minor_units() { + money = Money(minorUnits: 100_000) + XCTAssertEqual(money.minorUnits, 100_000) + XCTAssertEqual(money.integerValue, 1_000) + XCTAssertEqual(money, 1_000) + } +} + diff --git a/Tests/LocaleTests.swift b/Tests/LocaleTests.swift deleted file mode 100644 index 782e738..0000000 --- a/Tests/LocaleTests.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - -class LocaleTests: XCTestCase { - - var en_US: NSLocale! - var es_ES: NSLocale! - - override func setUp() { - super.setUp() - en_US = NSLocale(localeIdentifier: MNYLocale.English(.UnitedStates).localeIdentifier) - es_ES = NSLocale(localeIdentifier: MNYLocale.Spanish(.Spain).localeIdentifier) - } - - override func tearDown() { - en_US = nil - es_ES = nil - super.tearDown() - } - - func test__currency_code() { - XCTAssertEqual(en_US.mny_currencyCode, "USD") - XCTAssertEqual(es_ES.mny_currencyCode, "EUR") - } - - func test__currency_symbol() { - XCTAssertEqual(en_US.mny_currencySymbol, "$") - XCTAssertEqual(es_ES.mny_currencySymbol, "€") - } - - func test__currency_currencyGroupingSeparator() { - XCTAssertEqual(en_US.mny_currencyGroupingSeparator, ",") - XCTAssertEqual(es_ES.mny_currencyGroupingSeparator, ".") - } - - func test__currency_currencyDecimalSeparator() { - XCTAssertEqual(en_US.mny_currencyDecimalSeparator, ".") - XCTAssertEqual(es_ES.mny_currencyDecimalSeparator, ",") - } -} - diff --git a/Tests/MoneyFormattingTests.swift b/Tests/MoneyFormattingTests.swift new file mode 100644 index 0000000..2060b5a --- /dev/null +++ b/Tests/MoneyFormattingTests.swift @@ -0,0 +1,57 @@ +// +// Money +// File created on 24/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__description() { + money = 10 + #if os(OSX) + let result: String = money.formatted(forLocaleId: "en_GB") + XCTAssertEqual(result, "£10.00") + #elseif os(iOS) + let result: String = money.formatted(forLocaleId: "en_US") + XCTAssertEqual(result, "$10.00") + #endif + } + + func test__description_float() { + money = 10.12 + #if os(OSX) + let result: String = money.formatted(forLocaleId: "en_GB") + XCTAssertEqual(result, "£10.12") + #elseif os(iOS) + let result: String = money.formatted(forLocaleId: "en_US") + XCTAssertEqual(result, "$10.12") + #endif + } +} + +extension MoneyTestCase { + + func test__iso_description() { + gbp = 10 + let result: String = gbp.formatted(forLocaleId: "en_GB") + XCTAssertEqual(result, "£10.00") + } + + #if os(iOS) + func test__iso_description_spain() { + gbp = 10 + let result: String = gbp.formatted(forLocaleId: "es_ES") + // Note that for Spanish from Spain, the decimal point indicator is a comma, + // and the currency symbol is placed after the numbers. + XCTAssertEqual(result, "10,00 £") + } + #endif +} diff --git a/Tests/MoneyTestCase.swift b/Tests/MoneyTestCase.swift new file mode 100644 index 0000000..a9047aa --- /dev/null +++ b/Tests/MoneyTestCase.swift @@ -0,0 +1,36 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +class MoneyTestCase: XCTestCase { + + var money: Money! + var gbp: GBP! + + override func setUp() { + super.setUp() + } + + override func tearDown() { + money = nil + gbp = nil + super.tearDown() + } +} + +extension Money { + + static func makeZero() -> Money { + return Money() + } +} diff --git a/Tests/MoneyTests.swift b/Tests/MoneyTests.swift deleted file mode 100644 index 2df5773..0000000 --- a/Tests/MoneyTests.swift +++ /dev/null @@ -1,414 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - -class MoneyTestCase: XCTestCase { - - var money: Money! - var gbp: GBP! - var usd: USD! - var cad: CAD! - var aud: AUD! - var eur: EUR! - var jpy: JPY! - var btc: BTC! - - override func tearDown() { - super.tearDown() - money = nil - gbp = nil - usd = nil - cad = nil - eur = nil - jpy = nil - btc = nil - } -} - -class MoneyInitializerTests: MoneyTestCase { - - func test__money_initialize_with__nothing() { - money = Money() - XCTAssertEqual(money, 0) - } - - func test__money_initialize_with__one_int() { - money = Money(integerLiteral: 1) - XCTAssertEqual(money, 1) - } - - func test__money_is_negative() { - money = -10 - XCTAssertTrue(money.isNegative) - } - - func test__money_can_be_negated() { - money = 10 - XCTAssertEqual(money.negative, -10) - } - - func test__money_amount() { - money = 10 - XCTAssertEqual(money.amount, NSDecimalNumber(value: 10)) - } -} - -class MoneyEqualityTests: XCTestCase { - var aMoney: USD! - var bMoney: USD! - - func test__money_equals_money() { - aMoney = 6.66 - bMoney = 6.66 - XCTAssertEqual(aMoney, bMoney) - } - - func test__money_does_not_equal_money() { - aMoney = 6.66 - bMoney = 5.66 - XCTAssertNotEqual(aMoney, bMoney) - } -} - -class MoneyComparableTests: XCTestCase { - - func test__money_sorts() { - let monies: [Money] = [ 0, 12, 4.50, 9.99, 99, 9.99, 2.49, 16.69] - let sorted = monies.sorted() - XCTAssertEqual(sorted, [0, 2.49, 4.50, 9.99, 9.99, 12, 16.69, 99]) - } -} - -class MoneySignedNumberTests: XCTestCase { - - func test__money_negates() { - let money: Money = 16.49 - let modified = -money - XCTAssertEqual(modified, Money(floatLiteral: -16.49)) - } - - func test__money_subtracts() { - let a: Money = 16.49 - let b: Money = 6.49 - let result = a - b - XCTAssertEqual(result, Money(integerLiteral: 10)) - } -} - -class MoneySubtractionTests: XCTestCase { - - let money: JPY = 12_345.67 - let other: JPY = 10_000 - - func test__subtraction_int_1() { - XCTAssertEqual(money - 10_000, 2_345.67) - } - - func test__subtraction_int_2() { - XCTAssertEqual(10_000 - money, -2_345.67) - } - - func test__subtraction_float_1() { - XCTAssertEqual(money - 2_345.67, 10_000) - } - - func test__subtraction_float_2() { - XCTAssertEqual(2_345.67 - money, -10_000) - } -} - -class MoneyAddingTests: XCTestCase { - - let money: INR = 335_577.99 - let other: INR = 446_688.00 - - func test_addition() { - XCTAssertEqual(money + other, 782_265.99) - XCTAssertEqual(other + money, 782_265.99) - } - - func test__addition_int_interal() { - XCTAssertEqual(money + 10_000, 345_577.99) - XCTAssertEqual(10_000 + money, 345_577.99) - } - - func test__addition_float_interal() { - XCTAssertEqual(money + 2_345.67, 337_923.66) - XCTAssertEqual(2_345.67 + money, 337_923.66) - } -} - -class MoneyRemainderTests: XCTestCase { - var dividend: EUR! - var divisor: EUR! - - func test__remainer_all_positive() { - dividend = 37.50 - divisor = 5 - XCTAssertEqual(dividend % divisor, 2.50) - } - - func test__remainer_all_negative() { - dividend = -37.50 - divisor = -5 - XCTAssertEqual(dividend % divisor, -2.50) - } - - func test__remainer_negative_divisor() { - dividend = 37.50 - divisor = -5 - XCTAssertEqual(dividend % divisor, 2.50) - } - - func test__remainer_negative_dividend() { - dividend = -37.50 - divisor = 5 - XCTAssertEqual(dividend % divisor, -2.50) - } -} - -class MoneyMultiplicationTests: XCTestCase { - let money: CNY = 9.99 - - func test__multiplication_int_0() { - XCTAssertEqual(0 * money, 0) - } - - func test__multiplication_int_1() { - XCTAssertEqual(money * 1, money) - } - - func test__multiplication_int_2() { - XCTAssertEqual(money * 417, 4_165.83) - } - - func test__multiplication_float_0() { - XCTAssertEqual(0.0 * money, 0) - } - - func test__multiplication_float_1() { - XCTAssertEqual(money * 1.0, money) - } - - func test__multiplication_float_2() { - XCTAssertEqual(money * M_PI, 31.37) - } -} - -class MoneyDivisionTests: XCTestCase { - let money: EUR = 9.99 - -/* - func test__division_int_0() { - result = money / 0 - // This does throw an exception - but how can I - // write a test to verify that it does? - } -*/ - - func test__division_int_1() { - XCTAssertEqual(money / 1, money) - } - - func test__multiplication_int_2() { - XCTAssertEqual(money / 4, 2.50) - } - - func test__division_float_1() { - XCTAssertEqual(money / 1.0, money) - } - - func test__division_float_2() { - XCTAssertEqual(money / 4.0, 2.50) - } - - func test__division_float_3() { - XCTAssertEqual(money / 0.5, 19.98) - } - - func test__division_float_4() { - XCTAssertEqual(money / M_PI, 3.18) - } -} - -class MoneyConversionTests: XCTestCase { - let input: GBP = 100 - - func test__convert_with_rate_to_other() { - let output: EUR = input.convert(withRate: 1.2) - XCTAssertEqual(output, 120) - } -} - -class MoneyDescriptionTests: MoneyTestCase { - - override func setUp() { - super.setUp() - money = 3.99 - gbp = 100 - usd = 99 - cad = 102.01 - aud = 99.999 - eur = 249.499 - jpy = 32_000 - btc = 0.002_007 - } - - func test__money_description() { - XCTAssertEqual(money.description.endIndex, money.description.range(of: "3.99")?.upperBound) - } - - func test__gbp_description() { - XCTAssertEqual(gbp.currencyCode, "GBP") - XCTAssertEqual(gbp.currencySymbol, "£") - XCTAssertEqual(gbp.description, "£100.00") - } - - func test__usd_formatted_with_style() { - XCTAssertEqual(usd.currencyCode, "USD") - let formatted = usd.formatted(withStyle: .currency, forLocale: .English(.UnitedStates)) - XCTAssertEqual(formatted, "US$99.00") - } - - func test__btc_formatted_with_style() { - XCTAssertEqual(btc.currencyCode, "BTC") - let formatted = btc.formatted(withStyle: .currency, forLocale: .English(.UnitedStates)) - XCTAssertEqual(formatted, "Ƀ0.002007") - } - - func test__btc_formatted_with_style_for_locale() { - XCTAssertEqual(btc.currencyCode, "BTC") - let formatted = btc.formatted(withStyle: .currency, forLocale: .Spanish(.Mexico)) - XCTAssertEqual(formatted, "Ƀ0.002007") - } - - func test__cad_description() { - XCTAssertEqual(cad.currencyCode, "CAD") - XCTAssertEqual(cad.description, "CA$102.01") - } - - func test__aud_description() { - XCTAssertEqual(aud.currencyCode, "AUD") - XCTAssertEqual(aud.description, "A$100.00") - } - - func test__eur_description() { - XCTAssertEqual(eur.currencyCode, "EUR") - XCTAssertEqual(eur.description, "€249.50") - } - - func test__jpy_description() { - XCTAssertEqual(jpy.currencyCode, "JPY") - XCTAssertEqual(JPY.Currency.scale, 0) - if NSLocale.current.identifier == "en_US" { } - else { - XCTAssertEqual(jpy.description, "JP¥32,000") - } - } - - func test__jpy_formatted_with_style_for_locale() { - let formatted = jpy.formatted(withStyle: .currency, forLocale: .German(.Germany)) - XCTAssertEqual(formatted, "32.000 JP¥") - } -} - -class MoneyFormattingTests: MoneyTestCase { - - override func setUp() { - super.setUp() - gbp = 100 - usd = 99 - cad = 102.01 - aud = 99.999 - eur = 249.499 - jpy = 32_000 - } - - // Tests assume a en_GB test environment - func test__locale_identifier_equals_current_locale() { - let gb = NSLocale.current.identifier == MNYLocale.English(.UnitedKingdom).localeIdentifier - let us = NSLocale.current.identifier == MNYLocale.English(.UnitedStates).localeIdentifier - XCTAssertTrue(gb || us) - } - - func test__formatted_for_Spanish_Spain() { - let result = gbp.formatted(withStyle: .currency, forLocale: .Spanish(.Spain)) - XCTAssertEqual(result, "100,00 £") - } - - func test__formatted_for_English_UnitedKingdom() { - let result = gbp.formatted(withStyle: .currency, forLocale: .English(.UnitedKingdom)) - XCTAssertEqual(result, "£100.00") - } -} - -class MoneyValueCodingTests: XCTestCase { - - var money: Money! - - func archiveEncodedMoney() -> Data { - return NSKeyedArchiver.archivedData(withRootObject: money.encoded) - } - - func unarchive(_ archive: Data) -> Money? { - return Money.decode(NSKeyedUnarchiver.unarchiveObject(with: archive) as AnyObject?) - } - - func test__money_encodes() { - money = 10 - XCTAssertEqual(unarchive(archiveEncodedMoney()), money) - } -} - -class MoneyMinorUnitTests: XCTestCase { - - func test__money_with_USD_minor_amount_equality() { - XCTAssertEqual(USD(minorUnits: 3250), 32.50) - } - - func test__money_with_JPY_minor_amount_equality() { - XCTAssertEqual(JPY(minorUnits: 2170), 2170) - } - - func test__money_with_BTC_minor_amount_equality() { - XCTAssertEqual(BTC(minorUnits: 3000), 0.00003) - } - - func test__money_access_minor_units() { - XCTAssertEqual(JPY(integerLiteral: 1).minorUnits, 1) - XCTAssertEqual(USD(integerLiteral: 1).minorUnits, 100) - XCTAssertEqual(BTC(integerLiteral: 1).minorUnits, 1_0000_0000) - } -} - -class CustomCurrencyWithoutSymbol: CustomCurrencyType { - static let code: String = "DAN" - static let scale: Int = 3 - static let symbol: String? = nil -} - diff --git a/Tests/MultiplicationTests.swift b/Tests/MultiplicationTests.swift new file mode 100644 index 0000000..11b0d4d --- /dev/null +++ b/Tests/MultiplicationTests.swift @@ -0,0 +1,55 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__money_multiplation() { + money = 10 + let result = money * Money(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 100) + } + + func test__money_multiplation_by_integer_literals() { + money = 10 + let result = 3 * money * 2 + XCTAssertEqual(result, 60) + } + + func test__money_multiplation_by_float_literals() { + money = 10 + let result = 3.5 * money * 2.5 + XCTAssertEqual(result, 87.5) + } +} + +extension MoneyTestCase { + + func test__iso_multiplation() { + gbp = 10 + let result = gbp * GBP(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 100) + } + + func test__iso_multiplation_by_integer_literals() { + gbp = 10 + let result = 3 * gbp * 2 + XCTAssertEqual(result, 60) + } + + func test__iso_multiplation_by_float_literals() { + gbp = 10 + let result = 3.5 * gbp * 2.5 + XCTAssertEqual(result, 87.5) + } +} diff --git a/Tests/NSDecimalNumberTests.swift b/Tests/NSDecimalNumberTests.swift deleted file mode 100644 index 40f410b..0000000 --- a/Tests/NSDecimalNumberTests.swift +++ /dev/null @@ -1,111 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - -class NSDecimalNumberTests: XCTestCase { - - var a: NSDecimalNumber! - var b: NSDecimalNumber! - var behaviors: NSDecimalNumberBehaviors! - - override func setUp() { - super.setUp() - a = 10 - b = 20 - behaviors = DecimalNumberBehavior.Plain.decimalNumberBehaviors - } - - override func tearDown() { - a = nil - b = nil - behaviors = nil - super.tearDown() - } - - func test__zero_is_not_equal_to_one() { - XCTAssertNotEqual(NSDecimalNumber.zero, NSDecimalNumber.one) - } - - func test__zero_is_less_than_one() { - XCTAssertTrue(NSDecimalNumber.zero < NSDecimalNumber.one) - } - - func test__zero_is_greater_than_negative_one() { - XCTAssertTrue(NSDecimalNumber.zero > NSDecimalNumber.one.negate(withBehavior: behaviors)) - } - - func test__negative_one_is_negative() { - XCTAssertTrue(NSDecimalNumber.one.negate(withBehavior: behaviors).isNegative) - } - - func test__zero_is_not_negative() { - XCTAssertFalse(NSDecimalNumber.zero.isNegative) - XCTAssertFalse(NSDecimalNumber.one.isNegative) - } - - func test__addition() { - let result = a.adding(b, withBehavior: behaviors) - XCTAssertEqual(result, 30) - } - - func test__subtraction() { - let result = a.subtracting(b, withBehavior: behaviors) - XCTAssertEqual(result, -10) - } - - func test__multiplication() { - let result = a.multiplying(by: b, withBehavior: behaviors) - XCTAssertEqual(result, 200) - } - - func test__division() { - let result = a.dividing(by: b, withBehavior: behaviors) - XCTAssertEqual(result, 0.5) - } - - func test__remainder() { - let result = a.remainder(b, withBehavior: behaviors) - XCTAssertEqual(result, 10) - } - - func test__remainder_swift_documentation_examples() { - // https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/BasicOperators.html#//apple_ref/doc/uid/TP40014097-CH6-ID63 - - a = 9; b = 4 - XCTAssertEqual(a.remainder(b, withBehavior: behaviors), 1) - - a = -9; b = 4 - XCTAssertEqual(a.remainder(b, withBehavior: behaviors), -1) - - a = 9; b = -4 - XCTAssertEqual(a.remainder(b, withBehavior: behaviors), 1) - - a = 8; b = 2.5 - XCTAssertEqual(a.remainder(b, withBehavior: behaviors), 0.5) - } -} diff --git a/Tests/NSDecimalTests.swift b/Tests/NSDecimalTests.swift deleted file mode 100644 index 8632a5b..0000000 --- a/Tests/NSDecimalTests.swift +++ /dev/null @@ -1,116 +0,0 @@ -// -// Money, https://github.com/danthorpe/Money -// Created by Dan Thorpe, @danthorpe -// -// The MIT License (MIT) -// -// Copyright (c) 2015 Daniel Thorpe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -import XCTest -@testable import Money - -class DecimalTests: XCTestCase { - - var decimalNumberA: NSDecimalNumber! - var decimalNumberB: NSDecimalNumber! - var behaviors: NSDecimalNumberBehaviors! - var a: Decimal! - var b: Decimal! - - override func setUp() { - super.setUp() - decimalNumberA = 10 - decimalNumberB = 20 - behaviors = DecimalNumberBehavior.Plain.decimalNumberBehaviors - a = decimalNumberA.decimalValue - b = decimalNumberB.decimalValue - } - - override func tearDown() { - decimalNumberA = nil - decimalNumberB = nil - behaviors = nil - a = nil - b = nil - super.tearDown() - } - - func test__zero() { - XCTAssertEqual(Decimal.zero, NSDecimalNumber.zero.decimalValue) - } - - func test__zero_is_not_equal_to_one() { - XCTAssertNotEqual(Decimal.zero, Decimal.one) - } - - func test__zero_is_less_than_one() { - XCTAssertTrue(Decimal.zero < Decimal.one) - } - - func test__zero_is_greater_than_negative_one() { - XCTAssertTrue(Decimal.zero > Decimal.one.negate(withRoundingMode: behaviors.roundingMode())) - } - - func test__negative_one_is_negative() { - XCTAssertTrue(Decimal.one.negate(withRoundingMode: behaviors.roundingMode()).isNegative) - } - - func test__zero_is_not_negative() { - XCTAssertFalse(Decimal.zero.isNegative) - XCTAssertFalse(Decimal.one.isNegative) - } - - func test__addition() { - let result = a.adding(b, withRoundingMode: behaviors.roundingMode()) - let _result = decimalNumberA.adding(decimalNumberB, withBehavior: behaviors) - XCTAssertEqual(result, _result.decimalValue) - XCTAssertEqual(_result, 30) - } - - func test__subtraction() { - let result = a.subtracting(b, withRoundingMode: behaviors.roundingMode()) - let _result = decimalNumberA.subtracting(decimalNumberB, withBehavior: behaviors) - XCTAssertEqual(result, _result.decimalValue) - XCTAssertEqual(_result, -10) - } - - func test__multiplication() { - let result = a.multiplying(by: b, withRoundingMode: behaviors.roundingMode()) - let _result = decimalNumberA.multiplying(by: decimalNumberB, withBehavior: behaviors) - XCTAssertEqual(result, _result.decimalValue) - XCTAssertEqual(_result, 200) - } - - func test__division() { - let result = a.dividing(by: b, withRoundingMode: behaviors.roundingMode()) - let _result = decimalNumberA.dividing(by: decimalNumberB, withBehavior: behaviors) - XCTAssertEqual(result, _result.decimalValue) - XCTAssertEqual(_result, 0.5) - } - - func test__remainder() { - let result = a.remainder(b, withRoundingMode: behaviors.roundingMode()) - let _result = decimalNumberA.remainder(decimalNumberB, withBehavior: behaviors) - XCTAssertEqual(result, _result.decimalValue) - XCTAssertEqual(_result, 10) - } - -} diff --git a/Tests/SubtractionTests.swift b/Tests/SubtractionTests.swift new file mode 100644 index 0000000..ff41f40 --- /dev/null +++ b/Tests/SubtractionTests.swift @@ -0,0 +1,55 @@ +// +// Money +// File created on 15/09/2017. +// +// Copyright (c) 2015-2017 Daniel Thorpe +// +// Money is licensed under the MIT License. Read the full license at +// https://github.com/danthorpe/Money/blob/master/LICENSE +// + +import XCTest + +@testable import Money + +extension MoneyTestCase { + + func test__money_subtraction() { + money = 10 + let result = money - Money(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 0) + } + + func test__money_subtraction_by_integer_literals() { + money = 10 + let result = 3 - money - 2 + XCTAssertEqual(result, -9) + } + + func test__money_subtraction_by_float_literals() { + money = 10 + let result = 3.5 - money - 2.5 + XCTAssertEqual(result, -9) + } +} + +extension MoneyTestCase { + + func test__iso_subtraction() { + gbp = 10 + let result = gbp - GBP(decimal: Decimal(integerLiteral: 10)) + XCTAssertEqual(result, 0) + } + + func test__iso_subtraction_by_integer_literals() { + gbp = 10 + let result = 3 - gbp - 2 + XCTAssertEqual(result, -9) + } + + func test__iso_subtraction_by_float_literals() { + gbp = 10 + let result = 3.5 - gbp - 2.5 + XCTAssertEqual(result, -9) + } +}