예제 #1
0
        public void DisposeWithNoStreams()
        {
            // ARRANGE
            var    chain  = new ChainedStream(Enumerable.Empty <Stream>());
            Action action = () => chain.Dispose();

            // ACT, ASSERT
            action.ShouldNotThrow();
        }
예제 #2
0
        public void DisposeWhenNotStarted()
        {
            // ARRANGE
            var streamA = new DisposedStream(8);
            var streamB = new DisposedStream(8);
            var chain   = new ChainedStream(new[] { streamA, streamB });

            // ACT
            chain.Dispose();

            // ASSERT
            streamA.Disposed.Should().BeTrue();
            streamB.Disposed.Should().BeTrue();
        }
예제 #3
0
        public void DisposeWhenAllFinished()
        {
            // ARRANGE
            var streamA = new DisposedStream(8);
            var streamB = new DisposedStream(8);
            var chain   = new ChainedStream(new[] { streamA, streamB });

            chain.Read(new byte[16], 0, 16);

            // ACT
            chain.Dispose();

            // ASSERT
            streamA.Disposed.Should().BeTrue();
            streamB.Disposed.Should().BeTrue();
        }
예제 #4
0
 public void TearDown()
 {
     chained.Dispose();
     master.Dispose();
 }