public async Task <IHttpActionResult> Delete(CollegeKpiView view) { var result = _service.GetRecordResult(view); if (result == null) { return(BadRequest("The test record does not exist!")); } await _service.Delete(result); return(Ok()); }
public CollegeKpi GetRecordResult(CollegeKpiView view) { var college = _collegeRepository.GetByName(view.CollegeName); if (college == null) { return(null); } var time = view.TestTime; return(_repository.GetByCollegeIdAndTime(college.Id, time)); }
public static void AssertKpis(this CollegeKpiView view, int collegeId, double kpi) { Assert.AreEqual(view.CollegeName, "college-" + collegeId); Assert.AreEqual(view.Connection3G, kpi); }