예제 #1
0
        public async Task DecompressesFromExpectedBytes()
        {
            // Arrange
            var memoryStore = new InMemoryStore();
            await memoryStore.SetAsync(Key, new MemoryStream(OptimalCompressInputText), CancellationToken.None);

            var gzipStore = new GZipStore(memoryStore, CompressionLevel.Optimal);

            // Act, Assert
            await VerifyStringAsync(gzipStore, Key, InputText);
        }
예제 #2
0
        public async Task SupportsRoundTrip()
        {
            // Arrange
            var memoryStore = new InMemoryStore();
            var gzipStore   = new GZipStore(memoryStore, CompressionLevel.Optimal);

            // Act, Assert
            await gzipStore.SetAsync(Key, GetStream(InputText), CancellationToken.None);

            await VerifyStringAsync(gzipStore, Key, InputText);
        }
예제 #3
0
        public async Task CompressesToExpectedBytes()
        {
            // Arrange
            var memoryStore = new InMemoryStore();
            var gzipStore   = new GZipStore(memoryStore, CompressionLevel.Optimal);

            // Act
            await gzipStore.SetAsync(Key, GetStream(InputText), CancellationToken.None);

            // Assert
            await VerifyBytesAsync(memoryStore, Key, OptimalCompressInputText);
        }
예제 #4
0
        public async Task AdheresToProvidedCompressionLevel(CompressionLevel compression)
        {
            // Arrange
            var expected    = Compress(InputText, compression);
            var memoryStore = new InMemoryStore();
            var gzipStore   = new GZipStore(memoryStore, compression);

            // Act
            await gzipStore.SetAsync(Key, GetStream(InputText), CancellationToken.None);

            // Assert
            await VerifyBytesAsync(memoryStore, Key, expected);
        }