public void CouponStore_EmptyHasZeroDiscount() { var couponStore = new CouponStore(); Assert.Equal(0, couponStore.TotalDiscount(new List <ItemBase>() { })); }
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))); }
public void CouponStore_Add_SingleCoupon() { var couponStore = new CouponStore(); couponStore.Add(new BxGyCoupon() { itemName = "foo", X = 1, Y = 1 }); Assert.Equal(1, couponStore.TotalDiscount(SingleQuantityList(2, 1))); }
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))); }