示例#1
0
        public void return_error_when_todo_is_not_found()
        {
            const int someTodoId = 3;

            existRepository
            .Setup(x => x.Exist(someTodoId))
            .Returns(false);

            var result = service.Delete(someTodoId);

            result.IsOk.ShouldBeFalse();
        }
示例#2
0
        public IActionResult Delete(int todoId)
        {
            var resultExecution = service.Delete(todoId);

            if (resultExecution.IsOk)
            {
                return(Ok());
            }

            return(NotFound());
        }