This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public PurchaseContext(params IOrderPurchaseStrategy[] orderpurchaseStrategies) | |
{ | |
this.orderpurchaseStrategies = orderpurchaseStrategies; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class OnlineStorePurchase_PurchaseStrategy_Tests | |
{ | |
[TestInitialize] | |
public void SetupTest() | |
{ | |
Driver.StartBrowser(); | |
} | |
[TestCleanup] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class OnlineStorePurchase_AdvancedPurchaseStrategy_Tests | |
{ | |
[TestInitialize] | |
public void SetupTest() | |
{ | |
Driver.StartBrowser(); | |
} | |
[TestCleanup] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ShippingAddressPage : BasePageSingleton<ShippingAddressPage, ShippingAddressPageMap> | |
{ | |
public void ClickContinueButton() | |
{ | |
this.Map.ContinueButton.Click(); | |
} | |
public void FillShippingInfo(ClientPurchaseInfo clientInfo) | |
{ | |
this.Map.CountryDropDown.SelectByText(clientInfo.Country); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ClientPurchaseInfo | |
{ | |
public string FullName { get; set; } | |
public string Country { get; set; } | |
public string Address1 { get; set; } | |
public string City { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PurchaseFacade | |
{ | |
public void PurchaseItemSalesTax(string itemUrl, string itemPrice, string taxAmount, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo) | |
{ | |
PurchaseItemInternal(itemUrl, clientLoginInfo, clientPurchaseInfo); | |
PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(taxAmount); | |
} | |
public void PurchaseItemGiftWrapping(string itemUrl, string itemPrice, string giftWrapTax, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IOrderValidationStrategy | |
{ | |
void ValidateOrderSummary(string itemPrice, ClientPurchaseInfo clientPurchaseInfo); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PurchaseContext | |
{ | |
private readonly IOrderValidationStrategy orderValidationStrategy; | |
public PurchaseContext(IOrderValidationStrategy orderValidationStrategy) | |
{ | |
this.orderValidationStrategy = orderValidationStrategy; | |
} | |
public void PurchaseItem(string itemUrl, string itemPrice, ClientLoginInfo clientLoginInfo, ClientPurchaseInfo clientPurchaseInfo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SalesTaxOrderValidationStrategy : IOrderValidationStrategy | |
{ | |
public SalesTaxOrderValidationStrategy() | |
{ | |
this.SalesTaxCalculationService = new SalesTaxCalculationService(); | |
} | |
public SalesTaxCalculationService SalesTaxCalculationService { get; set; } | |
public void ValidateOrderSummary(string itemsPrice, ClientPurchaseInfo clientPurchaseInfo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VatTaxOrderValidationStrategy : IOrderValidationStrategy | |
{ | |
public VatTaxOrderValidationStrategy() | |
{ | |
this.VatTaxCalculationService = new VatTaxCalculationService(); | |
} | |
public VatTaxCalculationService VatTaxCalculationService { get; set; } | |
public void ValidateOrderSummary(string itemsPrice, ClientPurchaseInfo clientPurchaseInfo) |