public void GetGdCountry(string code, uint callingCode, string expectedCurrency) { Base.Country.Country country = CountryList.Get(CountryIso2Code.FromString(code)); Output.WriteLine($"Expected currency: {expectedCurrency}, output: {country.Currency.Code}"); Assert.Equal(callingCode, country.CallingCode); Assert.Equal(expectedCurrency, country.Currency.Code); }
public void ParseCountryIso2CodeTest(string code) { CountryIso2Code countryCode = CountryIso2Code.FromString(code); Output.WriteLine($"Expected: {code.ToUpper()} , output: {countryCode.Code}"); Assert.Equal(code.ToUpper(), countryCode.Code); }
public Country(string name, string namePrefix, string namePostfix, string codeIso2, string codeIso3, string currencyCode, uint callingCode, uint[] callingCodes) { Name = name; NameAllCaps = name.ToUpper(); NamePrefix = namePrefix; NamePostfix = namePostfix; CodeIso2 = CountryIso2Code.FromString(codeIso2); CodeIso3 = GdCountryIso3Code.FromString(codeIso3); Currency = CurrencyFiatCode.FromString(currencyCode); CallingCode = callingCode; CallingCodes = callingCodes; }
private BicCode(string code) { code = code.ToUpper(); if (code.Length != CODE_LENGTH && code.Length != CODE_LENGTH_WITH_BRANCH) { throw new InvalidPrimaryBicCode(code); } // Skip Branch code Code = code.Substring(0, CODE_LENGTH); // Set country code CountryCode = CountryIso2Code.FromString(code.Substring(4, 2)); // Unique bank code within the country above BankCode = code.Substring(0, 4); }
public void ParseCountryIso2CodeFailTest() { Assert.Throws <InvalidCountryCodeException>(() => CountryIso2Code.FromString("ZZ")); }