コード例 #1
0
        public void Create_IndividualPromotion_InvalidTest()
        {
            IPromotion createPromotion = new IndividualPromotionProcessor();

            Assert.Throws <InvalidOperationException>(() => createPromotion.Add(new IndividualPromotion
            {
                Price    = 180,
                Quantity = 5,
                Type     = PromotionType.Combo,
                Product  = ProductHelper.Get(Constants.A)
            }));
        }
コード例 #2
0
        public void Create_IndividualPromotion_Test()
        {
            IPromotion createPromotion = new IndividualPromotionProcessor();

            createPromotion.Add(new IndividualPromotion
            {
                Price    = 180,
                Quantity = 5,
                Type     = PromotionType.Individual,
                Product  = ProductHelper.Get(Constants.A)
            });

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