public void ReturnTrue() { //Arange var rule = new NotEnoughInventoryRule(); //Act && Assert Assert.AreEqual(true, rule.MatchCondition(new Dictionary <string, PriceModel>())); }
public void Throw_Exception_When_Quantity_Is_Not_Enough() { //Arrange IDictionary <string, PriceModel> books = new Dictionary <string, PriceModel>(); books.Add("Test", new PriceModel() { AvailableQuantity = 1, CategoryName = "Test", HaveDiscount = false, Price = 4, Quantity = 2 }); var rule = new NotEnoughInventoryRule(); //Act & Assert Assert.Throws <NotEnoughInventoryException>(() => rule.CalculateDiscount(books)); }