public void Update_return_bad_test() { FoodsController controller = GetController(doNotThrowException); EditedFood editedFood = GetInvalidFood(); var response = controller.Update(editedFood).GetType().Name; Assert.AreEqual(response, "NotFoundObjectResult"); }
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); }