public void CheckProductsOutage_EmptyList_ReturnsEmptyList() { ProductLibrary library = new ProductLibrary(); List <Product> products = new List <Product>(); IEnumerable <Product> result = library.CheckProductsOutage(new EnumerableQuery <Product>(products)); Assert.IsTrue(!result.Any()); }
public void CheckProductsOutage_LowQuantity_ReturnsLowProducts() { ProductLibrary library = new ProductLibrary(); List <Product> products = new List <Product>(); products.Add(new Product() { Name = "Test", Quantity = 1 }); IEnumerable <Product> result = library.CheckProductsOutage(new EnumerableQuery <Product>(products)); Assert.IsTrue(result.Count() == 1); Assert.IsTrue(result.Any(p => p.Name == "Test")); Assert.IsTrue(result.Any(p => p.Quantity == 1)); }