public async Task GetTodo_AllValid_ReturnsNoContentResult() { // Arrange var todoId = 1; var mockService = new Mock <ITodosService>(); mockService.Setup(ts => ts.DeleteTodoByIdAsync(todoId)); var controller = new TodosController(mockService.Object); // Action var result = await controller.DeleteTodo(todoId); // Assert Assert.NotNull(result); Assert.IsType <NoContentResult>(result); mockService.Verify(ts => ts.DeleteTodoByIdAsync(todoId), Times.Once()); }