Example #1
0
        public void ProcessCartTest_Italy_CartItemsAdded()
        {
            // Used constants.
            const string Distributor = "25657863";
            const string Locale      = "it-IT";

            // Getting a shopping cart for IT.
            var shoppingCart = MyHLShoppingCartGenerator.GetShoppingCart(
                12345,
                DateTime.Now,
                Locale,
                1,
                OrderCategoryType.RSO,
                DeliveryOptionType.Pickup,
                5,
                Distributor,
                "FREIGHT",
                "OrderType");
            var ruleEngine = new Ordering.Rules.Promotional.it_IT.PromotionalRules();

            // Getting a result.
            var result = ruleEngine.ProcessCart(
                shoppingCart, ShoppingCartRuleReason.CartItemsAdded);

            // Asserts.
            Assert.IsNotNull(result, "Cart Processed as Cart Items Being Added");
        }
Example #2
0
        public void ProcessCartTest_Italy_CartItemsRemoved()
        {
            // Used constants.
            const string Distributor = "25657863";
            const string Locale      = "it-IT";
            // Getting a shopping cart for IT.
            var shoppingCart = MyHLShoppingCartGenerator.GetBasicShoppingCart(Distributor, Locale, "FREIGHT", null, false, null, new List <DistributorShoppingCartItem>
            {
                ShoppingCartItemHelper.GetCatalogItems(1, 10, PromoU688, Locale)
            }, OrderCategoryType.RSO);
            var ruleEngine = new Ordering.Rules.Promotional.it_IT.PromotionalRules();

            shoppingCart.RuleResults = new List <ShoppingCartRuleResult>();
            // Getting a result.
            var result = ruleEngine.ProcessCart(
                shoppingCart, ShoppingCartRuleReason.CartItemsRemoved);

            // Asserts.
            Assert.IsNotNull(result, "Cart Processed as Cart Items Being Removed");
        }