Example #1
0
        public void GetByCompanyAsync_ReturnsDto_WhenFound()
        {
            const string companyName = "test";

            A.CallTo(() => _publisherDecorator.GetByCompanyAsync(companyName))
            .Returns(new Publisher());

            var publisherDto = _publisherService.GetByCompanyAsync(companyName);

            publisherDto.Should().NotBeNull();
        }
Example #2
0
        public async Task <PublisherDto> GetByCompanyAsync(string companyName, string culture = "en-US")
        {
            if (string.IsNullOrEmpty(companyName))
            {
                throw new InvalidServiceOperationException("Is empty company name");
            }

            var existingPublisher = await _publisherDecorator.GetByCompanyAsync(companyName);

            var dto = CreatePublisherDto(existingPublisher, culture);

            return(dto);
        }