public void GivenAnOrderDiscount_WhenApplyToNonOrder_ThenShouldReturnZero() { var sut = new OrderDiscount("d", 1); var line = new Line(new Bike(string.Empty, string.Empty, 1), 1); Assert.AreEqual(0, sut.Apply(line)); }
public void GivenAnOrderDiscount_WhenApplyToOrder_ThenShouldReturnOrderSubTotalTimesPercentage() { var sut = new OrderDiscount("d", 1); var order = new Order(string.Empty); order.AddLine(new Line(new Bike(string.Empty, string.Empty, 1), 1)); Assert.AreEqual(order.CalculateSubTotal() * sut.Percentage, sut.Apply(order)); }