예제 #1
0
        public void Update_return_bad_test()
        {
            FoodsController controller = GetController(doNotThrowException);
            EditedFood      editedFood = GetInvalidFood();
            var             response   = controller.Update(editedFood).GetType().Name;

            Assert.AreEqual(response, "NotFoundObjectResult");
        }
예제 #2
0
        public void Update_catchException_test()
        {
            FoodsController controller = GetController(throwException);
            EditedFood      editedFood = GetFood();
            var             response   = controller.Update(editedFood) as BadRequestObjectResult;
            var             message    = response.Value.GetType().Name;

            Assert.AreEqual("Exception", message);
        }