Ejemplo n.º 1
0
        public void Return_30_4_when_buy_2_book_1_and_2_book_2()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 2);
            shoppingBasket.Add(2, 2);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(8 * 4 * 0.95);
        }
Ejemplo n.º 2
0
        public void Return_16_when_buy_2_same_book_and_a_different_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 1);
            shoppingBasket.Add(2, 2);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(16 * 0.95 + 8);
        }
Ejemplo n.º 3
0
        public void Return_21_6_when_buy_3_different_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 1);
            shoppingBasket.Add(2, 1);
            shoppingBasket.Add(3, 1);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(24 * 0.90);
        }
Ejemplo n.º 4
0
        public void OneFirstBookAndOneSecondBookCosts15Euros20()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(new FirstBook());
            shoppingBasket.Add(new SecondBook());
            var total    = shoppingBasket.Total();
            var expected = new Euros(15.20);

            Assert.That(total, Is.EqualTo(expected));
        }
Ejemplo n.º 5
0
        public void TwoFirstBooksCosts16Euros()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(new FirstBook());
            shoppingBasket.Add(new FirstBook());
            var total    = shoppingBasket.Total();
            var expected = new Euros(16);

            Assert.That(total, Is.EqualTo(expected));
        }
Ejemplo n.º 6
0
        public void Return_30_when_buy_5_different_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 1);
            shoppingBasket.Add(2, 1);
            shoppingBasket.Add(3, 1);
            shoppingBasket.Add(4, 1);
            shoppingBasket.Add(5, 1);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(8 * 5 * 0.75);
        }
Ejemplo n.º 7
0
        public void Return_51_20_when_buy_52_different_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 2);
            shoppingBasket.Add(2, 2);
            shoppingBasket.Add(3, 2);
            shoppingBasket.Add(4, 1);
            shoppingBasket.Add(5, 1);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(51.20);
        }
Ejemplo n.º 8
0
        public void Return_16_when_buy_2_copy_of_the_same_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 2);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(16);
        }
Ejemplo n.º 9
0
        public void Return_8_when_buy_a_book()
        {
            var shoppingBasket = new ShoppingBasket();

            shoppingBasket.Add(1, 1);
            var price = shoppingBasket.Price();

            Check.That(price).IsEqualTo(8);
        }
Ejemplo n.º 10
0
 public void TwoFirstBooksCosts16Euros()
 {
     var shoppingBasket = new ShoppingBasket();
     shoppingBasket.Add(new FirstBook());
     shoppingBasket.Add(new FirstBook());
     var total = shoppingBasket.Total();
     var expected = new Euros(16);
     Assert.That(total, Is.EqualTo(expected));
 }
Ejemplo n.º 11
0
        public void OneFirstBookAndOneSecondBookCosts15Euros20()
        {
            var shoppingBasket = new ShoppingBasket();
            shoppingBasket.Add(new FirstBook());
            shoppingBasket.Add(new SecondBook());
            var total = shoppingBasket.Total();
            var expected = new Euros(15.20);

            Assert.That(total, Is.EqualTo(expected));
        }