public void TestMethod1() { SqlCatalogRepository rep = new SqlCatalogRepository(); IQueryable <Category> qry = rep.GetCategories(); Assert.IsNotNull(qry); IList <Category> catList = (from c in qry where c.ID == 1 select c).ToList <Category>(); Assert.AreEqual(1, catList.Count); Assert.AreEqual("Category 1", catList[0].Name); }
public void SqlCatalogRepository_ShouldReturn_Categories_AsQueryable() { var rep = new SqlCatalogRepository(); var qry = rep.GetCategories(); Assert.NotNull(qry); var catList = (from c in qry where c.ID == 1 select c).ToList(); Assert.Single(catList); Assert.Equal(catList[0].Name, "category1"); }