public async Task GetAllToDoCommandHandlerTestShouldReturnGetAllToDoCommandObject() { var command = new GetAllToDoCommand { User = "******" }; var handler = new GetAllToDoCommandHandler(_toDoRepositoryMock.Object); _toDoRepositoryMock.Setup(a => a.Search(a => a.User == command.User)).ReturnsAsync(listToDoItem); //Act var result = await handler.Handle(command, new CancellationToken()); result.Should().NotBeEmpty(); }
public async Task <IEnumerable <TodoItem> > Handle(GetAllToDoCommand request, CancellationToken cancellationToken) { var dados = await _todoRepository.Search(a => a.User == request.User); return(await Task.FromResult(dados)); }