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

            // ACT, ASSERT
            action.ShouldNotThrow();
        }
        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();
        }
        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();
        }
Example #4
0
 public void TearDown()
 {
     chained.Dispose();
     master.Dispose();
 }