Ejemplo n.º 1
0
        public async Task Should_ignore_exception_if_app_image_to_backup_does_not_exist()
        {
            var imageStream = new MemoryStream();

            var context = CreateBackupContext();

            A.CallTo(() => context.Writer.OpenBlobAsync(A <string> ._, ct))
            .Returns(imageStream);

            A.CallTo(() => appImageStore.DownloadAsync(appId, imageStream, ct))
            .Throws(new AssetNotFoundException("Image"));

            await sut.BackupEventAsync(Envelope.Create(new AppImageUploaded()), context, ct);
        }
Ejemplo n.º 2
0
        public async Task Should_ignore_exception_when_app_image_to_backup_does_not_exist()
        {
            var imageStream = new MemoryStream();

            var context = CreateBackupContext();

            A.CallTo(() => context.Writer.WriteBlobAsync(A <string> .Ignored, A <Func <Stream, Task> > .Ignored))
            .Invokes((string _, Func <Stream, Task> handler) => handler(imageStream));

            A.CallTo(() => appImageStore.DownloadAsync(appId, imageStream, default))
            .Throws(new AssetNotFoundException("Image"));

            await sut.BackupEventAsync(Envelope.Create(new AppImageUploaded()), context);
        }