public void Test_GetResult_OneTestItem(int collegeId, string testDate, int hour, int users) { _repository.MockOneItem(collegeId, DateTime.Parse(testDate).AddHours(hour), users); var result = _service.GetResult(DateTime.Parse(testDate), hour, "college-" + collegeId); Assert.IsNotNull(result, "the result is null"); result.AssertUsers(users); }
public IHttpActionResult Get(DateTime date, int hour, string name) { var result = _service.GetResult(date, hour, name); return(result == null ? (IHttpActionResult)BadRequest("Bad College Name!") : Ok(result)); }