示例#1
0
        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));
        }
示例#3
0
 public static void AssertKpis(this CollegeKpiView view, int collegeId, double kpi)
 {
     Assert.AreEqual(view.CollegeName, "college-" + collegeId);
     Assert.AreEqual(view.Connection3G, kpi);
 }