public void CheckCurrencyFormat(Currency currency, string puttern) { HomePage homePage = LoadHomePage(); homePage = homePage.ChooseCurrency(currency); homePage.AddProductToCart(ProductRepository.GetIPhone()); cartPage = homePage.GotoShoppingCartPage(); SelectShippingMethodComponent ShippingMethod = cartPage.ApplySippingAndTaxes(ShippingDetailsRepository.GetUADetails()); cartPage = ShippingMethod.ApllyShippingMethod(); Thread.Sleep(2000); // for presentation ONLY Total = cartPage.GetPriceOption("Total:"); SubTotal = cartPage.GetPriceOption("Sub-Total:"); FlatShippingRate = cartPage.GetPriceOption("Flat Shipping Rate:"); FixedTestTax = cartPage.GetPriceOption(TaxRateRepository.GetFixTaxRate().Name + ":"); PercentageTestTax = cartPage.GetPriceOption(TaxRateRepository.GetPercentageTaxRate().Name + ":"); StringAssert.IsMatch(puttern, Total); StringAssert.IsMatch(puttern, SubTotal); StringAssert.IsMatch(puttern, FlatShippingRate); StringAssert.IsMatch(puttern, FixedTestTax); StringAssert.IsMatch(puttern, PercentageTestTax); // for presentation ONLY Console.WriteLine(Total); Console.WriteLine(SubTotal); Console.WriteLine(FlatShippingRate); Console.WriteLine(PercentageTestTax); Console.WriteLine(FixedTestTax); }
public void CheckFixedTaxHasTheSameValueAsInAdminPanel() { HomePage homePage = LoadHomePage(); homePage.AddProductToCart(ProductRepository.GetIPhone()); cartPage = homePage.GotoShoppingCartPage(); SelectShippingMethodComponent ShippingMethod = cartPage.ApplySippingAndTaxes(ShippingDetailsRepository.GetUADetails()); cartPage = ShippingMethod.ApllyShippingMethod(); Thread.Sleep(2000); // for presentation ONLY decimal fixedTestTax = cartPage.GetPriceOptionValue(TaxRateRepository.GetFixTaxRate().Name + ":"); decimal expectedResult = 2m; Assert.AreEqual(expectedResult, fixedTestTax); }