public ActionResult Delete(int id) { try { return(Ok(_recipeBusiness.DeleteRecipe(id))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public void TesteEditarPedido_Sucesso() { var id = 1; var name = "Teste"; var description = "Testando"; var imgPath = "TestePath"; var recipes = _recipeBusiness.ListRecipes().FirstOrDefault(x => x.Id == id);; _recipeBusiness.AddRecipe(new RecipeDto() { Id = id, Name = name, Description = description, ImgPath = imgPath }); _recipeBusiness.DeleteRecipe(id); var recipeConsulta = _recipeBusiness.ListRecipes().FirstOrDefault(x => x.Id == id); Assert.IsNull(recipeConsulta); }