private static void AssertErrorResponse( ManageDeprecationJsonApiController controller, JsonResult result, HttpStatusCode code, string error) { AssertResponseStatusCode(controller, code); // Using JObject to get the property from the result easily. // Alternatively we could use reflection, but this is easier, and makes sense as the response is intended to be JSON anyway. var jObject = JObject.FromObject(result.Data); Assert.Equal(error, jObject["error"].Value <string>()); }
private static void AssertSuccessResponse( ManageDeprecationJsonApiController controller) { AssertResponseStatusCode(controller, HttpStatusCode.OK); }