public async Task ChangeCoverASync()
        {
            var product = (await _gigRepository.GetListAsync()).First();
            var input   = new ChangeGigImageDto()
            {
                CoverImage = "changeGIgImage",
                Content    = new byte[] { 1, 2, 34, 4, 5, 53, 25 }
            };

            var result = await _gigAppService.ChangeCoverAsync(product.Id, input);

            result.ShouldNotBeNull();
            result.CoverImage.ShouldContain(input.CoverImage);
        }
Beispiel #2
0
        public async Task <GigDto> ChangeCoverAsync(Guid id, ChangeGigImageDto input)
        {
            var gig = await GetGigIfExistsAsync(id);

            var imageFileName = await _gigPictureContainerManager.UpdateAsync(
                gig.CoverImage,
                input.CoverImage,
                input.Content,
                true);

            await _gigManager.ChangeCoverImageAsync(gig, imageFileName);

            var result = await Repository.UpdateAsync(gig);

            return(await MapToGetOutputDtoAsync(result));
        }