private void ValidatePurchaseAlertMessage(PurchaseAlert purchaseAlert) { var currentDate = DateTime.Today.AddMonths(-1).ToString("d/M/yyyy", CultureInfo.CreateSpecificCulture("en-US")); Assert.That(purchaseAlert.IsPurchaseAlertDisplayed(), Is.True); Assert.AreEqual(User.Name, purchaseAlert.GetPurchaseUserName()); Assert.AreEqual(CartPage.TotalAmount + " USD", purchaseAlert.GetPurchaseTotalAmount()); Assert.AreEqual(User.CreditCardNumber, purchaseAlert.GetPurchaseCreditCardNumber()); Assert.AreEqual(currentDate, purchaseAlert.GetPurchaseDate()); }
public void Should_Add_Produc_And_Submit_OrderPage() { var homePage = loginPage.LoginApplication("*****@*****.**", "automation"); productPage = homePage.loggedInMenuItemControl.SelectProductAndNavigateToProductPage(NewPhone); TotalAmount = productPage.AddProduct(); var expectedResult = new AlertsType().ProductAddedSuccessfully; var actualResult = productPage.GetAlert(); Assert.AreEqual(expectedResult, actualResult); cartPage = homePage.loggedInMenuItemControl.NavigateToCart(); Assert.IsTrue(cartPage.IsProductAddedToCart(NewPhone.ProductName)); orderPage = cartPage.PlaceOrder(); purchaseAlert = orderPage.SetOrder(new AddOrderElements()); Assert.IsTrue(purchaseAlert.IsPurchaseAlertDisplayed()); }