Пример #1
0
        public void PercentOffOrder_Coupon_Should_Have_Code_and_Apply_Method_That_Takes_Order()
        {
            Order order = GetTestOrder();
            PercentOffOrderCoupon coupon = new PercentOffOrderCoupon(10);

            //this shouldn't fail
            coupon.ApplyCoupon(order);
        }
Пример #2
0
        public void Incentive_Should_Have_Code_Coupon_Expiration()
        {
            ICoupon coupon = new PercentOffOrderCoupon(10);

            Incentive i = new Incentive("XYZ", coupon, DateTime.Today.AddDays(1));

            Assert.AreEqual("XYZ", i.Code);
            Assert.AreEqual(coupon, i.Coupon);
            Assert.IsFalse(i.IsExpired);
        }
Пример #3
0
        public void PercentOffOrder_Coupon_Should_Reduce_Order_SubTotal_By_TenPercent()
        {
            Order   order                = GetTestOrder();
            decimal preSubTotal          = order.SubTotal;
            decimal postSubTotal         = order.SubTotal - order.SubTotal * 0.1M;
            PercentOffOrderCoupon coupon = new PercentOffOrderCoupon(10);

            coupon.ApplyCoupon(order);
            Assert.AreEqual(postSubTotal, order.SubTotal);
        }