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); }
public UserDictionary GetByCategory(int id, string category) { if (!id.Validate() && String.IsNullOrEmpty(category)) { throw new Exception("Invalid model"); } return(rep.GetByCategory(id, category)); }
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")); } }