private void AssertDiscountRate(int numberOfBooks, int expectedDiscountPercentage) { var rateCard = new DiscountRateCard(); var discount = rateCard.CalculateDiscountRate(numberOfBooks); Assert.That(discount, Is.EqualTo(expectedDiscountPercentage)); Debug.WriteLine("{0} books gives {1}% discount", numberOfBooks, expectedDiscountPercentage); }
public void PassingDiscountRateCardAnInvalidNumberOfBooksCausesException() { var rateCard = new DiscountRateCard(); Assert.Throws<ArgumentException>(() => rateCard.CalculateDiscountRate(8)); }
public void DiscountRateIsThePercentageOfTotalPriceToBePaid() { var rateCard = new DiscountRateCard(); Assert.That(rateCard.CalculateRateToCharge(2), Is.EqualTo(0.95m)); }