Beispiel #1
0
        public void TestDeleteRecipeValidInput()
        {
            //Arrange

            //Act
            bool   result = _recipeManager.DeleteRecipe(100000);
            Recipe recipe = _recipeManager.RetrieveRecipeByID(100000);

            //Assert
            Assert.IsTrue(result);
            Assert.IsNull(recipe);
        }
Beispiel #2
0
        public IActionResult DeleteRecipe(int id)
        {
            var result = _recipeManager.DeleteRecipe(id);

            if (result)
            {
                return(Ok(result));
            }
            return(NotFound());
        }
        public JsonResult Delete(int id)
        {
            var result = _recipeManager.DeleteRecipe(id);

            return(Json(result, JsonRequestBehavior.DenyGet));
        }