public void Expect_Stream_IsClosed_AfterClose() { var testStream = new HelperMemoryStream(); var bitWriter = new BitWriter(testStream, Encoding.Default); bitWriter.Close(); Assert.IsTrue(testStream.IsClosed); }
public void Expect_Stream_RemainsOpen_AfterClose() { var testStream = new HelperMemoryStream(); var bitWriter = new BitWriter(testStream, Encoding.Default, true); bitWriter.Close(); Assert.IsFalse(testStream.IsClosed); }
public void Expect_Stream_AttemptsToCloseUnderlyingStream_OnDispose() { var testStream = new HelperMemoryStream(); using (new BitWriter(testStream, Encoding.Default)) { } Assert.IsTrue(testStream.IsClosed); }