Created
July 9, 2015 20:47
-
-
Save angelovstanton/4c2e010d5d056d0ed960 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 VatTaxOrderValidationStrategy : IOrderValidationStrategy | |
{ | |
public VatTaxOrderValidationStrategy() | |
{ | |
this.VatTaxCalculationService = new VatTaxCalculationService(); | |
} | |
public VatTaxCalculationService VatTaxCalculationService { get; set; } | |
public void ValidateOrderSummary(string itemsPrice, ClientPurchaseInfo clientPurchaseInfo) | |
{ | |
Countries currentCountry = (Countries)Enum.Parse(typeof(Countries), clientPurchaseInfo.Country); | |
decimal currentItemPrice = decimal.Parse(itemsPrice); | |
decimal vatTax = this.VatTaxCalculationService.Calculate(currentItemPrice, currentCountry); | |
PlaceOrderPage.Instance.Validate().EstimatedTaxPrice(vatTax.ToString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment