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); }
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); }
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); }