public async Task ReturnAllValueItems(List <ValueItem> valueItems) { itemRepository.Get().Returns(valueItems); var resultItems = await queryHandler.Handle(new GetValueItemsQueryRequest(), CancellationToken.None); resultItems.Items.Should().BeEquivalentTo(valueItems); }
public async Task <GetValueItemResponse> Handle(GetValueItemRequest request, CancellationToken cancellationToken) { logger.LogInformation("Test logging {@Request}", request); // this should go in a behavior var valueItem = await valueItemRepository.Get(request.Key); return(new GetValueItemResponse(valueItem)); }
public async Task <GetValueItemsQueryResponse> Handle(GetValueItemsQueryRequest request, CancellationToken cancellationToken) { _logger.LogInformation("Retrieving all value items"); var items = await _itemRepository.Get(); _logger.LogInformation("Retrieved {items.Count} value items", items.Count); return(new GetValueItemsQueryResponse(items)); }