public void WordRepositoryTest_Words_getByCategory() { var count = context.Object.Words.GroupBy(x => x.Category).Where(x => x.Key.Equals("Category2")).Count(); var rep_count = rep.GetByCategory("Category2").Count(); Assert.AreEqual(count, rep_count, string.Format(count + " != " + rep_count)); }
public void WordServiceTest_GetByCategory_valid() { var expected = rep.GetByCategory("Category1").Count(); var actual = service.GetByCategory("Category1").Count(); Assert.AreEqual(expected, actual); }
public IQueryable <Word> GetByCategory(string category) { if (String.IsNullOrEmpty(category)) { throw new Exception("Invalid model"); } return(rep.GetByCategory(category)); }