Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            RecipeCategory RecipeCategory = _recipeCategoryService.GetById(id);

            _recipeCategoryService.Delete(RecipeCategory);
            return(RedirectToAction("Index"));
        }
        public void Delete_ShouldCallRepositoryRemove()
        {
            //Arrange
            var recipeCategory = new RecipeCategory()
            {
            };

            _repository.GetById(1).Returns(recipeCategory);

            //Act
            _service.Delete(1);

            //Assert
            _repository.Received(1).Remove(recipeCategory);
        }