Exemple #1
0
        public ClientTest()
        {
            item1 = new SKU()
            {
                Id = "A", Price = 50
            };
            item2 = new SKU()
            {
                Id = "B", Price = 30
            };
            item3 = new SKU()
            {
                Id = "C", Price = 20
            };
            item4 = new SKU()
            {
                Id = "D", Price = 15
            };
            List <SKU> _itemList1 = new List <SKU>();

            _itemList1.Add(item3);
            _itemList1.Add(item4);

            SKUDiscount discount = new SKUDiscount()
            {
                SKUDiscountId = 1, UnitCount = 3, Discount = 130
            };
            SKUDiscount discount1 = new SKUDiscount()
            {
                SKUDiscountId = 1, UnitCount = 2, Discount = 45
            };
            SKUDiscount discount2 = new SKUDiscount()
            {
                SKUDiscountId = 2, Discount = 30
            };

            _promotionEngine.setPromotions(item1, discount);
            _promotionEngine.setPromotions(item2, discount1);
            _promotionEngine.setPromotions(_itemList1, discount2);
        }