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(); }
public IActionResult Delete(int todoId) { var resultExecution = service.Delete(todoId); if (resultExecution.IsOk) { return(Ok()); } return(NotFound()); }