Example #1
0
        public void CheckNoDiscountProducts()
        {
            var offer           = new DiscountOffer("Soup", 0.3m);
            var discountProduct = offer.DetermineSpecialOffer(_products);

            Assert.IsNull(discountProduct);
        }
Example #2
0
        public void CheckEggDiscount()
        {
            var offer           = new DiscountOffer("Eggs", 0.1m);
            var discountProduct = offer.DetermineSpecialOffer(_products);

            //expecting 10% off the price of Eggs (30p), so discountProduct should be 3p
            Assert.AreEqual("Eggs 10% off", discountProduct.ProductName);
            Assert.AreEqual(-0.03m, discountProduct.Price);
        }