예제 #1
0
        public void Expect_Stream_IsClosed_AfterClose()
        {
            var testStream = new HelperMemoryStream();
            var bitWriter  = new BitWriter(testStream, Encoding.Default);

            bitWriter.Close();

            Assert.IsTrue(testStream.IsClosed);
        }
예제 #2
0
        public void Expect_Stream_RemainsOpen_AfterClose()
        {
            var testStream = new HelperMemoryStream();
            var bitWriter  = new BitWriter(testStream, Encoding.Default, true);

            bitWriter.Close();

            Assert.IsFalse(testStream.IsClosed);
        }
예제 #3
0
        public void Expect_Stream_AttemptsToCloseUnderlyingStream_OnDispose()
        {
            var testStream = new HelperMemoryStream();

            using (new BitWriter(testStream, Encoding.Default))
            {
            }

            Assert.IsTrue(testStream.IsClosed);
        }