示例#1
0
        public async Task GetDoneForTomorrowToDoCommandHandlerTestShouldReturnGetDoneForTomorrowToDoCommandObject()
        {
            var command = new GetDoneForTomorrowToDoCommand
            {
                User = "******"
            };


            var handler = new GetDoneForTomorrowToDoCommandHandler(_toDoRepositoryMock.Object);

            _toDoRepositoryMock.Setup(a => a.Search(a => a.User == command.User && a.Done && a.Date == DateTime.Now.AddDays(1))).ReturnsAsync(listToDoItem);

            //Act
            var result = await handler.Handle(command, new CancellationToken());

            result.Should().NotBeEmpty();
        }
示例#2
0
        public async Task <IEnumerable <TodoItem> > Handle(GetDoneForTomorrowToDoCommand request, CancellationToken cancellationToken)
        {
            var dados = await _todoRepository.Search(a => a.User == request.User && a.Done && a.Date == DateTime.Now.AddDays(1));

            return(await Task.FromResult(dados));
        }