public void volume_discount_is_not_applied_to_less_than_10_items_percent(int numItems) { // arrange var expected = new Price(new Amount(Currency.DKK, 25 * numItems), new Amount(Currency.DKK, 25 * numItems) * 0.25m); var taxCalculator = new DanishTaxCalculationStrategy(); var sut = new PriceWithTaxCalculator(taxCalculator, new VolumeDiscount(new SimpleTotalAmountCalculator())); var order = CreateOrder(sut, 25, isConsumer: true, numItems: numItems); // act var actual = order.CreateBill().Price; // assert Assert.Equal(expected, actual); }
public void volume_discount_is_10_percent(int itemPrice) { // arrange var expected = new Price(new Amount(Currency.DKK, itemPrice * 40) * 0.9m, new Amount(Currency.DKK, itemPrice * 10) * 0.9m); var taxCalculator = new DanishTaxCalculationStrategy(); var sut = new PriceWithTaxCalculator(taxCalculator, new VolumeDiscount(new SimpleTotalAmountCalculator())); var order = CreateOrder(sut, itemPrice, isConsumer: true, numItems: 40); // act var actual = order.CreateBill().Price; // assert Assert.Equal(expected, actual); }