public void CalculateTaxForPrice(decimal priceValue, int taxRateValue, decimal expectedPrice) { // Arrange var price = new Price(priceValue); var taxRate = new TaxRate(taxRateValue); // Act var tax = taxRate.GetTaxFor(price); // Assert tax.Value.ShouldBe(expectedPrice); }
public TotalPrice(TaxRate taxRate, Price price) { TaxRate = taxRate; PriceBeforeTax = price; PriceAfterTax = price + taxRate.GetTaxFor(price); }