public void GetTestWithValidValue(string culture, double value, string expectedResult) { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo(culture)); string actualResult = wordAmount.Get(value, true); Assert.AreEqual(expectedResult, actualResult); }
public void GetTestWithCulturePTBRWithChangedCunjunctionForCents() { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo("pt-BR")); wordAmount.ConjunctionForCents = " com "; Assert.AreEqual(" com ", wordAmount.ConjunctionForCents); string actual = wordAmount.Get(1.01, true); Assert.AreEqual("Um real com um centavo", actual); }
public void GetTestWithCurrencyChanged(string culture, double value, string expectedResult) { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo(culture)); wordAmount.CurrencyWordSingular = "Euro"; Assert.AreEqual("Euro", wordAmount.CurrencyWordSingular); wordAmount.CurrencyWordPlural = "Euros"; Assert.AreEqual("Euros", wordAmount.CurrencyWordPlural); string actualResult = wordAmount.Get(value, true); Assert.AreEqual(expectedResult, actualResult); }
public void GetTestWithDoubleMaxValue(string culture) { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo(culture)); wordAmount.Get(double.MaxValue, true); }
public void GetTestWithZeroValue(string culture) { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo(culture)); wordAmount.Get(0.00, true); }
public void CreateTestWithAvailableCulture() { IWordAmount wordAmount = WordAmountFactory.Create(WordAmountFactory.AvailableCultures()[0]); Assert.IsNotNull(wordAmount); }
public void CreateTestWithInvalidCulture() { IWordAmount wordAmount = WordAmountFactory.Create(CultureInfo.GetCultureInfo("il")); }