Esempio n. 1
0
        private static void AddCampaigns(Category category, Implementation.ShoppingCart cart)
        {
            var campaign1 = new Campaign(category, 20, 3, Campaign.DiscountType.Rate);
            var campaign2 = new Campaign(category, 50, 5, Campaign.DiscountType.Rate);
            var campaign3 = new Campaign(category, 3, 3, Campaign.DiscountType.Amount);

            cart.ApplyDiscounts(campaign1, campaign2, campaign3);
        }
Esempio n. 2
0
        private static Implementation.ShoppingCart CreateShoppingCart(Category category)
        {
            var apple  = new Product("apple", category, 100);
            var almond = new Product("almond", category, 150);

            var cart = new Implementation.ShoppingCart(new List <ShoppingCartItemDto>());

            cart.AddItem(apple, 3);
            cart.AddItem(almond, 1);
            return(cart);
        }
Esempio n. 3
0
        private static void AddCoupon(Implementation.ShoppingCart cart)
        {
            var coupon = new Coupon(100, 10, Campaign.DiscountType.Rate);

            cart.AddCoupon(coupon);
        }