2014-02-19 18 views

回答

2
HttpResponseException ex = Assert.Throws<HttpResponseException>(() => ApiController.Post("query-params-string", "request-body-json"));<br> 
Assert.AreEqual(ex.Response.StatusCode, HttpStatusCode.NotFound);