Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add tests for writing after close/finish

  • Loading branch information...
commit 6711a5ce4e878bf43d10c10b96485fcdd5ae3ec3 1 parent 1cd3933
@jfreilly jfreilly authored
Showing with 39 additions and 0 deletions.
  1. +39 −0 tests/GZip/GZipTests.cs
View
39 tests/GZip/GZipTests.cs
@@ -192,8 +192,47 @@ public void DoubleClose()
s.Finish();
s.Close();
s.Close();
+
+ memStream=new TrackedMemoryStream();
+ using( GZipOutputStream no2=new GZipOutputStream(memStream) )
+ {
+ s.Close();
+ }
+ }
+
+ [Test]
+ public void WriteAfterFinish()
+ {
+ TrackedMemoryStream memStream=new TrackedMemoryStream();
+ GZipOutputStream s=new GZipOutputStream(memStream);
+ s.Finish();
+
+ try
+ {
+ s.WriteByte(7);
+ Assert.Fail("Write should fail");
+ }
+ catch
+ {
+ }
}
+ [Test]
+ public void WriteAfterClose()
+ {
+ TrackedMemoryStream memStream=new TrackedMemoryStream();
+ GZipOutputStream s=new GZipOutputStream(memStream);
+ s.Close();
+
+ try
+ {
+ s.WriteByte(7);
+ Assert.Fail("Write should fail");
+ }
+ catch
+ {
+ }
+ }
[Test]
[Category("GZip")]
Please sign in to comment.
Something went wrong with that request. Please try again.