Beispiel #1
0
        public void Update_catch_exception_test()
        {
            ConsumedFoodsController controller = GetController(throwException);
            var response = controller.Update(GetConsumedFoods()) as BadRequestObjectResult;
            var message  = response.Value.GetType().Name;

            Assert.AreEqual(message, "Exception");
        }
Beispiel #2
0
        public void Update_return_ok_test()
        {
            ConsumedFoodsController controller   = GetController(doNotThrowException);
            ConsumedFoodsModel      consumedFood = GetConsumedFoods();

            consumedFood.IdFood = "Registered_Test_Food";
            var response = controller.Update(consumedFood).GetType().Name;

            Assert.AreEqual(response, "OkObjectResult");
        }