public void GuessesTheImageServiceTest_GetByCategory_count() { var expected = rep.GetByCategory("Category2").Count(); var actual = service.GetByCategory("Category2").Count(); Assert.AreEqual(expected, actual); }
public IQueryable <GuessesTheImageToReturn> GetByCategory(string category) { if (String.IsNullOrEmpty(category)) { throw new Exception("Invalid model"); } return(rep.GetByCategory(category)); }
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")); } }