public async Task <CatalogueItemDto> GetByIdAsync(string catalogueItemId, CancellationToken cancellationToken) { var result = await catalogueItemRepository.GetByIdAsync(catalogueItemId, cancellationToken); if (result is null) { throw new NotFoundException(nameof(CatalogueItemDto), catalogueItemId); } return(new CatalogueItemDto(result.CatalogueItemId, result.Name)); }
public async Task GetByIdAsync_CatalogueItemIdIsNull_ReturnsNull() { var request = await catalogueItemRepository.GetByIdAsync(null, CancellationToken.None); request.Should().BeNull(); }