Пример #1
0
        public void PerformDiscountRangeRules_BrWithDiscount50()
        {
            // Used constants.
            const string Distributor = "09550499";
            const string Locale      = "pt-BR";

            // Getting a shopping cart for BR.
            var brazilShoppingCart = MyHLShoppingCartGenerator.GetBasicShoppingCart(Distributor, Locale);
            var ruleEngine         = new Ordering.Rules.Discount.pt_BR.DiscountRules();

            // Getting a result.
            var result = ruleEngine.PerformDiscountRangeRules(brazilShoppingCart, Locale, 50.0M);

            // Asserts.
            Assert.AreEqual(result, string.Empty, "Discount range should be empty for a DS with 50% of discount.");
        }
Пример #2
0
        public void PerformDiscountRangeRules_BrWithDiscount35VP500()
        {
            // Used constants.
            const string Distributor = "09550499";
            const string Locale      = "pt-BR";

            // Getting a shopping cart for BR.
            var brazilShoppingCart = MyHLShoppingCartGenerator.GetBasicShoppingCart(
                Distributor,
                Locale,
                new OrderTotals_V01
            {
                VolumePoints       = 500M,
                DiscountPercentage = 35M
            });
            var ruleEngine = new Ordering.Rules.Discount.pt_BR.DiscountRules();

            // Getting a result.
            var result = ruleEngine.PerformDiscountRangeRules(brazilShoppingCart, Locale, 35.0M);

            // Asserts.
            Assert.AreEqual(result, "500-999",
                            "Discount range should be 500-999 for a DS with 35% of discount and VP < 1000.");
        }