Пример #1
0
        public void ScenarioB()
        {
            promotionEngine = new PromotionEngine();
            _cart           = new Cart();

            _cart.Items.Add(new Sku()
            {
                Code = "A", Name = "A", Price = 50
            });
            _cart.Items.Add(new Sku()
            {
                Code = "A", Name = "A", Price = 50
            });
            _cart.Items.Add(new Sku()
            {
                Code = "A", Name = "A", Price = 50
            });
            _cart.Items.Add(new Sku()
            {
                Code = "A", Name = "A", Price = 50
            });
            _cart.Items.Add(new Sku()
            {
                Code = "A", Name = "A", Price = 50
            });

            _cart.Items.Add(new Sku()
            {
                Code = "B", Name = "B", Price = 30
            });
            _cart.Items.Add(new Sku()
            {
                Code = "B", Name = "B", Price = 30
            });
            _cart.Items.Add(new Sku()
            {
                Code = "B", Name = "B", Price = 30
            });
            _cart.Items.Add(new Sku()
            {
                Code = "B", Name = "B", Price = 30
            });
            _cart.Items.Add(new Sku()
            {
                Code = "B", Name = "B", Price = 30
            });

            _cart.Items.Add(new Sku()
            {
                Code = "C", Name = "C", Price = 20
            });

            Assert.AreEqual(370, promotionEngine.GetOrderValue(_cart));
        }