public void TestEmptyJsonRequest() { ShowsController controller = new ShowsController(); JsonRequest request = new JsonRequest(); var response = controller.FilterShows(request); Assert.AreEqual(response.StatusCode, HttpStatusCode.OK); }
public void TestInvalidJson() { ShowsController controller = new ShowsController(); controller.Request = new HttpRequestMessage(); controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration()); // request will be null in case of bad json string JsonRequest request = null; //act var response = controller.FilterShows(request); Assert.AreEqual(response.StatusCode, HttpStatusCode.BadRequest); }