Пример #1
0
        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();
        }
Пример #2
0
        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));
        }