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); }
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); }
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); }
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); }