public void GuessesTheImageServiceTest_GetByCategory_count()
        {
            var expected = rep.GetByCategory("Category2").Count();
            var actual   = service.GetByCategory("Category2").Count();

            Assert.AreEqual(expected, actual);
        }
示例#2
0
 public IQueryable <GuessesTheImageToReturn> GetByCategory(string category)
 {
     if (String.IsNullOrEmpty(category))
     {
         throw new Exception("Invalid model");
     }
     return(rep.GetByCategory(category));
 }
示例#3
0
 public void GuessesTheImageTest_GuessesTheImages_getByCategory_nullException()
 {
     try
     {
         rep.GetByCategory(null);
     }
     catch (Exception e)
     {
         Assert.AreEqual("Value cannot be null.", e.Message, string.Format("result != expected"));
     }
 }