示例#1
0
        public void Create_ComboPromotion_InvalidTest()
        {
            IPromotion createPromotion = new ComboPromotionProcessor();

            Assert.Throws <InvalidOperationException>(() => createPromotion.Add(new ComboPromotion
            {
                Price    = 80,
                Quantity = 2,
                Type     = PromotionType.Individual,
                Products = ProductHelper.GetProducts(Constants.A, Constants.B, Constants.C)
            }));
        }
示例#2
0
        public void Create_ComboPromotion_Test()
        {
            IPromotion createPromotion = new ComboPromotionProcessor();

            createPromotion.Add(new ComboPromotion
            {
                Price    = 80,
                Quantity = 2,
                Type     = PromotionType.Combo,
                Products = ProductHelper.GetProducts(Constants.A, Constants.B, Constants.C)
            });

            Assert.AreEqual(2, createPromotion.TotalPromotions);
        }