public void TestMethod_Only_ItemD() { //Arrange IPromotion promotion = null; promotion = new Promotion1(); PromotionResult promotionResult = new PromotionResult(promotion); promotionResult.Items.Add(new ItemD() { NoOfItems = 1, Cost = 15 }); //Act var result = promotionResult.Calculate(); //Assert Assert.AreEqual <double>(result, 15); }
public void TestMethod_ScenarioD() { //Arrange IPromotion promotion = null; promotion = new Promotion1(); PromotionResult promotionResult = new PromotionResult(promotion); promotionResult.Items.Add(new ItemA() { NoOfItems = 3, Cost = 50 }); promotionResult.Items.Add(new ItemB() { NoOfItems = 5, Cost = 30 }); promotionResult.Items.Add(new ItemC() { NoOfItems = 1, Cost = 20 }); promotionResult.Items.Add(new ItemD() { NoOfItems = 1, Cost = 15 }); //Act var result = promotionResult.Calculate(); //Assert Assert.AreEqual <double>(result, 280); }