Created
July 9, 2015 20:47
-
-
Save angelovstanton/3094cc470fd813786df3 to your computer and use it in GitHub Desktop.
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) | |
{ | |
States currentState = (States)Enum.Parse(typeof(States), clientPurchaseInfo.State); | |
decimal currentItemPrice = decimal.Parse(itemsPrice); | |
decimal salesTax = this.SalesTaxCalculationService.Calculate(currentItemPrice, currentState, clientPurchaseInfo.Zip); | |
PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(salesTax.ToString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment