public void Purchase_SeleniumTestingToolsCookbook()
        {
            string itemUrl = "/Selenium-Testing-Cookbook-Gundecha-Unmesh/dp/1849515743";
            string itemPrice = "40.49";
            ClientPurchaseInfo clientPurchaseInfo = new ClientPurchaseInfo(
            new ClientAddressInfo()
            {
                FullName = "John Smith",
                Country = "United States",
                Address1 = "950 Avenue of the Americas",
                State = "New York",
                City = "New York City",
                Zip = "10001-2121",
                Phone = "00164644885569"
            })
            {
                GiftWrapping = GiftWrappingStyles.None
            };
            ClientLoginInfo clientLoginInfo = new ClientLoginInfo()
            {
                Email = "*****@*****.**",
                Password = "******"
            };

            new PurchaseContext(new SalesTaxOrderValidationStrategy()).PurchaseItem(itemUrl, itemPrice, clientLoginInfo, clientPurchaseInfo);
        }
 private void PurchaseItemInternal(string itemUrl, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
 {
     ItemPage.Instance.Navigate(itemUrl);
     ItemPage.Instance.ClickBuyNowButton();
     PreviewShoppingCartPage.Instance.ClickProceedToCheckoutButton();
     SignInPage.Instance.Login(clientLoginInfo.Email, clientLoginInfo.Password);
     ShippingAddressPage.Instance.FillShippingInfo(clientPurchaseInfo);
     ShippingAddressPage.Instance.ClickContinueButton();
     ShippingPaymentPage.Instance.ClickBottomContinueButton();
     ShippingPaymentPage.Instance.ClickTopContinueButton();
 }
 public void PurchaseItem(string itemUrl, string itemPrice, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
 {
     ItemPage.Instance.Navigate(itemUrl);
     ItemPage.Instance.ClickBuyNowButton();
     PreviewShoppingCartPage.Instance.ClickProceedToCheckoutButton();
     SignInPage.Instance.Login(clientLoginInfo.Email, clientLoginInfo.Password);
     ShippingAddressPage.Instance.FillShippingInfo(clientPurchaseInfo);
     ShippingAddressPage.Instance.ClickContinueButton();
     ShippingPaymentPage.Instance.ClickBottomContinueButton();
     ShippingPaymentPage.Instance.ClickTopContinueButton();
     this.orderValidationStrategy.ValidateOrderSummary(itemPrice, clientPurchaseInfo);
 }
        public void Purchase_SeleniumTestingToolsCookbook()
        {
            string itemUrl = "/Selenium-Testing-Cookbook-Gundecha-Unmesh/dp/1849515743";
            string itemPrice = "40.49";
            var shippingInfo = new ClientAddressInfo()
            {
                FullName = "John Smith",
                Country = "United States",
                Address1 = "950 Avenue of the Americas",
                State = "New York",
                City = "New York City",
                Zip = "10001-2121",
                Phone = "00164644885569"
            };
            var billingInfo = new ClientAddressInfo()
            {
                FullName = "Anton Angelov",
                Country = "Bulgaria",
                Address1 = "950 Avenue of the Americas",
                City = "Sofia",
                Zip = "1672",
                Phone = "0894464647"
            };
            ClientPurchaseInfo clientPurchaseInfo = new ClientPurchaseInfo(billingInfo, shippingInfo)
            {
                GiftWrapping = Enums.GiftWrappingStyles.Fancy
            };
            ClientLoginInfo clientLoginInfo = new ClientLoginInfo()
            {
                Email = "*****@*****.**",
                Password = "******"
            };

            new PurchaseContext(new SalesTaxOrderPurchaseStrategy(), new VatTaxOrderPurchaseStrategy(), new GiftOrderPurchaseStrategy())
            .PurchaseItem(itemUrl, itemPrice, clientLoginInfo, clientPurchaseInfo);
        }
 public void PurchaseItemShippingTax(string itemUrl, string itemPrice, string shippingTax, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
 {
     PurchaseItemInternal(itemUrl, clientLoginInfo, clientPurchaseInfo);
     PlaceOrderPage.Instance.Validate().ShippingTaxPrice(shippingTax);
 }
 public void PurchaseItemGiftWrapping(string itemUrl, string itemPrice, string giftWrapTax, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
 {
     PurchaseItemInternal(itemUrl, clientLoginInfo, clientPurchaseInfo);
     PlaceOrderPage.Instance.Validate().GiftWrapPrice(giftWrapTax);
 }
 public void PurchaseItemSalesTax(string itemUrl, string itemPrice, string taxAmount, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo)
 {
     PurchaseItemInternal(itemUrl, clientLoginInfo, clientPurchaseInfo);
     PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(taxAmount);
 }