public IHttpActionResult GetFilesByStudentId(int id) { var files = fileRepo.GetFilesByStudentId(id).ToList(); if (!files.Any()) { return(Content(HttpStatusCode.NotFound, "List is empty")); } return(Ok(files)); }
public void GetFilesByStudentIdTest() { UnitOfWork unit = new UnitOfWork(); FileRepo repo = unit.FileRepo(); var expected = 2; var actual = repo.GetFilesByStudentId(7).First().FileId; Assert.AreEqual(expected, actual); }