Пример #1
0
        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));
        }
Пример #2
0
        public void WordServiceTest_GetByCategory_valid()
        {
            var expected = rep.GetByCategory("Category1").Count();
            var actual   = service.GetByCategory("Category1").Count();

            Assert.AreEqual(expected, actual);
        }
Пример #3
0
 public IQueryable <Word> GetByCategory(string category)
 {
     if (String.IsNullOrEmpty(category))
     {
         throw new Exception("Invalid model");
     }
     return(rep.GetByCategory(category));
 }