Example #1
0
        public void IfTwoB15IsSpecialOfferApplied()
        {
            var checkout = new Checkout();

            checkout.AddShoppingItem("B15");
            checkout.AddShoppingItem("B15");

            var basketTotal = checkout.GetBasketTotal();

            Assert.AreEqual(basketTotal, 45);
        }
Example #2
0
        public void CheckoutReturnsCorrectTotalForMultipleItems()
        {
            var checkout = new Checkout();

            checkout.AddShoppingItem("A99");
            checkout.AddShoppingItem("B15");

            var basketTotal = checkout.GetBasketTotal();

            Assert.AreEqual(basketTotal, 80);
        }
Example #3
0
        public void IfThreeA99IsSpecialOfferApplied()
        {
            var checkout = new Checkout();

            checkout.AddShoppingItem("A99");
            checkout.AddShoppingItem("A99");
            checkout.AddShoppingItem("A99");

            var basketTotal = checkout.GetBasketTotal();

            Assert.AreEqual(basketTotal, 130);
        }
Example #4
0
        public void IsSpecialOfferAppliedWhenItemOrderDiffers()
        {
            var checkout = new Checkout();

            checkout.AddShoppingItem("A99");
            checkout.AddShoppingItem("B15");
            checkout.AddShoppingItem("C40");
            checkout.AddShoppingItem("T34");
            checkout.AddShoppingItem("B15");


            var basketTotal = checkout.GetBasketTotal();

            Assert.AreEqual(basketTotal, 254);
        }
Example #5
0
        public void CheckoutReturnsCorrectTotalWhenOneItemAdded(string SKU, double unitPrice)
        {
            var checkout = new Checkout();

            checkout.AddShoppingItem(SKU);

            var basketTotal = checkout.GetBasketTotal();

            Assert.AreEqual(basketTotal, unitPrice);
        }