Esempio n. 1
0
        public void Create_Passing_Valid_Values_Returns_Currency(Currency.CodeName code)
        {
            var cultureInfo = GetCultureInfo(code);

            var actual = Currency.Create(code);

            Assert.AreEqual(cultureInfo.NumberFormat.CurrencySymbol, actual.Symbol);
            Assert.AreEqual(code.ToString(), actual.Code);
            Assert.AreEqual(new RegionInfo(cultureInfo.Name).CurrencyNativeName, actual.Name);
        }
Esempio n. 2
0
 private static CultureInfo GetCultureInfo(Currency.CodeName code)
 => CultureInfo.GetCultures(CultureTypes.SpecificCultures)
 .First(culture => new RegionInfo(culture.LCID).ISOCurrencySymbol == code.ToString());