public void UpdatePratoFail2() { var pratoTest = repo.Where(r => r.Nome == "Prato6").FirstOrDefault(); pratoTest.Nome = null; var controller = new PratoController(db); var actionResult = controller.UpdatePrato(pratoTest); var result = actionResult as BadRequestObjectResult; Assert.IsNotNull(result); Assert.AreEqual(400, result.StatusCode); }
public void UpdatePratoFail() { var pratoTest = new Prato { RestauranteId = 1, Nome = "Prato5", Preco = 50m }; var controller = new PratoController(db); var actionResult = controller.UpdatePrato(pratoTest); var result = actionResult as NotFoundResult; Assert.IsNotNull(result); Assert.AreEqual(404, result.StatusCode); }