public void CatalogRepository_ProductFilter_Returns_5_Products_With_Category_11() { ICatalogRepository rep = new TestCatalogRepository(); Assert.AreEqual(5, rep.GetProducts() .WithCategory(11) .Count()); }
public void CatalogRepository_Returns_Single_Product_When_Filtered_By_ID_1() { ICatalogRepository rep = new TestCatalogRepository(); Assert.AreEqual(1, rep.GetProducts() .WithID(1) .ToList().Count()); }
public void CatalogRepository_Has_Category_Filter_ForProducts() { ICatalogRepository rep = new TestCatalogRepository(); IList <Product> prod = rep.GetProducts() .WithCategory(11) .ToList(); Assert.IsNotNull(prod); }
public void CatalogRepository_Each_Category_Contains_5_Products() { ICatalogRepository rep = new TestCatalogRepository(); var cat = rep.GetCategories() .Where(x => x.ParentID.HasValue) .ToList(); Assert.AreEqual(10, cat.Count()); var prod = rep.GetProducts(); foreach (Category c in cat) { int prodCount = (from p in prod where p.CategoryID == c.ID select p).Count(); Assert.AreEqual(5, prodCount, String.Format("For category {0}", c.ID)); } Assert.IsNotNull(rep.GetProducts()); }
public void CatalogRepository_Contains_Products() { ICatalogRepository r = new TestCatalogRepository(); Assert.IsNotNull(r.GetProducts()); }
public void Setup() { ICatalogRepository rep = new TestCatalogRepository(); catalogService = new CatalogService(rep); }
public void CatalogRepository_Repository_Is_Not_Null() { ICatalogRepository rep = new TestCatalogRepository(); Assert.IsNotNull(rep.GetCategories()); }