public void Return_False_When_Pass_More_Than_One_Book() { //Arrange IDictionary <string, PriceModel> books = new Dictionary <string, PriceModel>(); books.Add("Test", new PriceModel() { AvailableQuantity = 2, CategoryName = "Test", HaveDiscount = false, Price = 4, Quantity = 2 }); books.Add("Test2", new PriceModel() { AvailableQuantity = 2, CategoryName = "Test", HaveDiscount = false, Price = 4, Quantity = 2 }); var rule = new SinglePriceRule(); //Act var result = rule.MatchCondition(books); //Assert Assert.AreEqual(false, result); }
public void Return_False_For_Discount() { //Arrange IDictionary <string, PriceModel> books = new Dictionary <string, PriceModel>(); books.Add("Test", new PriceModel() { AvailableQuantity = 2, CategoryName = "Test", HaveDiscount = true, Price = 4, Quantity = 2 }); var rule = new SinglePriceRule(); //Act var result = rule.CalculateDiscount(books); //Assert Assert.AreEqual(false, result["Test"].HaveDiscount); }