public void ApplyPromotionTestForScenarioC() { IPromotionEngine engine = new EngineService.PromotionEngine(); Cart cart = new Cart(); cart.Items = new List <CartItem>(); cart.Items.Add(new CartItem() { Quantity = 3, ProductInfo = new ProductInfo("A", 50) }); cart.Items.Add(new CartItem() { Quantity = 5, ProductInfo = new ProductInfo("B", 30) }); cart.Items.Add(new CartItem() { Quantity = 1, ProductInfo = new ProductInfo("C", 20) }); cart.Items.Add(new CartItem() { Quantity = 1, ProductInfo = new ProductInfo("D", 15) }); engine.ApplyPromotion(cart); Assert.AreEqual(280, cart.TotalPrice); }
public void ApplyPromotionWithEmptyCart() { IPromotionEngine engine = new EngineService.PromotionEngine(); engine.ApplyPromotion(new Cart()); }
public void ApplyPromotionWithNull() { IPromotionEngine engine = new EngineService.PromotionEngine(); engine.ApplyPromotion(null); }