public void PostSchool_ReturnsHttpOkResult() { School school = _schoolDetails.Result.Where(s => s.SchoolId == 1).First(); CreateSchoolDto detailSchool = SchoolAutoMapper.Mapper().Map <CreateSchoolDto>(school); detailSchool.SchoolName = "Test Modified"; var result = _schoolController.Post(detailSchool); Assert.IsInstanceOf <OkObjectResult>(result); }
public JsonResult AddSchool(School School) { SchoolController obj = new SchoolController(); var response = obj.Post(School); return(Json(((SchoolApi.School)(((System.Net.Http.ObjectContent)(response.Content)).Value)).ID, JsonRequestBehavior.AllowGet)); }