Exemple #1
0
        public void TestEmptyJsonRequest()
        {
            ShowsController controller = new ShowsController();

            JsonRequest request  = new JsonRequest();
            var         response = controller.FilterShows(request);

            Assert.AreEqual(response.StatusCode, HttpStatusCode.OK);
        }
Exemple #2
0
        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);
        }