public void AddCurrentSale_AfterAddingLastSale_AppliesNewDiscountPercent() { var discountCard = new DiscountCard(1500); var totalPriceWithOnePercentDiscount = discountCard.Apply(1000); discountCard.AddCurrentSale(1000); Assert.Equal(990, totalPriceWithOnePercentDiscount); Assert.Equal(970, discountCard.Apply(1000)); }
public void Apply_WithRoundings() { var discountCard = new DiscountCard(7); var priceWithDiscount = discountCard.Apply(91.5m); priceWithDiscount.ShouldBe(85.10m); }
public void Apply_WithoutRoundings() { var discountCard = new DiscountCard(10); var priceWithDiscount = discountCard.Apply(100m); priceWithDiscount.ShouldBe(90m); }
public void GetTotalPrice_WithoutDiscountPercent_ReturnsUnitPrice() { var discountCard = new DiscountCard(); Assert.Equal(10, discountCard.Apply(10)); }
public void GetTotalPrice_WithDiscountPercent_ReturnsReducedPrice() { var discountCard = new DiscountCard(1500); Assert.Equal(990, discountCard.Apply(1000)); }