public void TestInit() { Stream baseStream = new MemoryStream(); GZipStream gzipStream = new GZipStream(baseStream, CompressionMode.Decompress); Assert.AreSame(baseStream, gzipStream.BaseStream); gzipStream.Close(); }
public void TestDecompress() { Stream baseStream = new MemoryStream(this.compressedData); GZipStream gzipStream = new GZipStream(baseStream, CompressionMode.Decompress); StreamReader reader = new StreamReader(gzipStream); string data = reader.ReadToEnd(); Assert.AreEqual(Data, data); gzipStream.Close(); }
public void TestProperties() { Stream baseStream = new MemoryStream(this.compressedData); GZipStream gzipStream = new GZipStream(baseStream, CompressionMode.Decompress); Assert.IsTrue(gzipStream.CanRead); Assert.IsFalse(gzipStream.CanWrite); Assert.IsFalse(gzipStream.CanSeek); try { long i = gzipStream.Length; } catch (NotSupportedException) {} try { long i = gzipStream.Position; } catch (NotSupportedException) {} try { gzipStream.Position = 0; } catch (NotSupportedException) {} }
public void TestNotSupported() { Stream baseStream = new MemoryStream(this.compressedData); GZipStream gzipStream = new GZipStream(baseStream, CompressionMode.Decompress); try { gzipStream.Write(null, 0, 0); } catch (NotSupportedException) {} try { gzipStream.Flush(); } catch (NotSupportedException) {} try { gzipStream.Seek(0, SeekOrigin.Begin); } catch (NotSupportedException) {} try { gzipStream.SetLength(0); } catch (NotSupportedException) {} }
public void TestDestructor() { using (GZipStream stream = new GZipStream(new MemoryStream(), CompressionMode.Decompress)) { } }