Ejemplo n.º 1
0
        public void NoBooksCostZero()
        {
            var price = PotterBooks.CalculatePriceFor(string.Empty);

            AssertPrice(price, 0 * PotterBooks.UnitBookPrice);
        }
Ejemplo n.º 2
0
        [TestCase("AAAAABBBBBCCCCDDDDDEEEE", (3 * (5 * PotterBooks.UnitBookPrice * 0.75d)) + (2 * (4 * PotterBooks.UnitBookPrice * 0.80d)))] // = ABCDE + ABCDE + ABCDE + ABCD + ABDE
        public void EdgeCaseIsPricedCorrectly(string books, double expectedPrice)
        {
            var price = PotterBooks.CalculatePriceFor(books);

            AssertPrice(price, expectedPrice);
        }
Ejemplo n.º 3
0
        public void MultipleBooksOfDifferentTypesArePricedCorrectly(string books, double expectedPrice)
        {
            var price = PotterBooks.CalculatePriceFor(books);

            AssertPrice(price, expectedPrice);
        }
Ejemplo n.º 4
0
        public void SimpleDiscountCombinationsArePricedCorrectly(string books, double expectedPrice)
        {
            var price = PotterBooks.CalculatePriceFor(books);

            AssertPrice(price, expectedPrice);
        }
Ejemplo n.º 5
0
        public void ASingleBookIsPricedCorrectly(string books)
        {
            var price = PotterBooks.CalculatePriceFor(books);

            AssertPrice(price, 1 * PotterBooks.UnitBookPrice);
        }