Exemplo n.º 1
0
        public void UserDictionaryServiceTest_GetByCategory_valid()
        {
            var expected = rep.GetByCategory(1, "Category1").Words.Count();
            var actual   = service.GetByCategory(1, "Category1").Words.Count();

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
 public UserDictionary GetByCategory(int id, string category)
 {
     if (!id.Validate() && String.IsNullOrEmpty(category))
     {
         throw new Exception("Invalid model");
     }
     return(rep.GetByCategory(id, category));
 }
Exemplo n.º 3
0
 public void UserDictionaryRepositoryTest_UserWords_getByCategory_nullException()
 {
     try
     {
         rep.GetByCategory(1, null);
     }
     catch (Exception e)
     {
         Assert.AreEqual("Value cannot be null.", e.Message, string.Format("result != expected"));
     }
 }