Exemple #1
0
        public void CouponStore_Add_MultipleCouponsDifferentOrder()
        {
            var couponStore = new CouponStore();

            couponStore.Add(new PercentOffCoupon()
            {
                percent = 10,
            });
            couponStore.Add(new BxGyCoupon()
            {
                itemName = "foo",
                X        = 1,
                Y        = 1
            });
            Assert.Equal(1.1m, couponStore.TotalDiscount(SingleQuantityList(2, 1)));
        }
Exemple #2
0
        public void CouponStore_Add_SameCouponItemOverwritesLast()
        {
            var couponStore = new CouponStore();

            couponStore.Add(new BxGyCoupon()
            {
                itemName = "foo",
                X        = 1,
                Y        = 1
            });
            couponStore.Add(new BxGyCoupon()
            {
                itemName = "foo",
                X        = 2,
                Y        = 1
            });
            Assert.Equal(1, couponStore.TotalDiscount(SingleQuantityList(3, 1)));
        }
Exemple #3
0
        public void CouponStore_Add_CouponDoesNotApply()
        {
            var couponStore = new CouponStore();

            couponStore.Add(new BxGyCoupon()
            {
                itemName = "does_not_exist",
                X        = 1,
                Y        = 1
            });
            Assert.Equal(0, couponStore.TotalDiscount(SingleQuantityList(2, 1)));
        }