public void GetQuntityStrategyResultForOneItem() { var cartList = new List <CartWithPromotionType>(); cartList.Add(new CartWithPromotionType() { cart = new Cart() { Quantity = 1, SkuId = 'A' }, promotionType = PromotionTypes.Quantity }); promotionStrategy = new QuantityPromotion(query); var result = promotionStrategy.ApplyPromotion(cartList); Assert.AreEqual(50, result); }
public void GetComboStrategyResultOnlyFirtOfCombo() { var cartList = new List <CartWithPromotionType>(); cartList.Add(new CartWithPromotionType() { cart = new Cart() { Quantity = 1, SkuId = 'C' }, promotionType = PromotionTypes.Combo }); promotionStrategy = new ComboPromotion(query); var result = promotionStrategy.ApplyPromotion(cartList); Assert.AreEqual(20, result); }