Exemplo n.º 1
0
            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>());
            }
Exemplo n.º 2
0
 private static void AssertSuccessResponse(
     ManageDeprecationJsonApiController controller)
 {
     AssertResponseStatusCode(controller, HttpStatusCode.OK);
 }