Beispiel #1
0
        public void ShouldGiveMoreDiscount()
        {
            var shoppingCart = new ShoppingCart();

            shoppingCart.AddDiscount(100, 5);
            shoppingCart.AddDiscount(200, 10);

            shoppingCart.AddItem(70, 2);
            shoppingCart.AddItem(50, 2);

            Assert.AreEqual(shoppingCart.Total, 216);
        }
        public void AddDiscount_ReturnNewPrice(ShoppingCart <ProductConditionDiscount> cart)
        {
            ProductDiscount disc2 = new ProductDiscount(1m, 1, ProductType.MILK, 1, ProductType.MILK);

            cart.AddDiscount(disc2);
            Assert.Equal(3.25m, cart.TotalPrice);
        }