예제 #1
0
        public void HappyFlow()
        {
            CheckDisposeStream checkDisposeStream = new CheckDisposeStream();

            CombinedStream sut = new CombinedStream(FixedTestData.CreateStreams(checkDisposeStream));

            FixedTestData.AssertStream(sut, FixedTestData.Structure);

            Assert.IsTrue(checkDisposeStream.DisposeCalled);
        }
예제 #2
0
        public void HappyFlow()
        {
            Stream testData = new CombinedStream(FixedTestData.CreateStreams());

            BatchingPipe <Packet <byte> > packetsPipe = new BatchingPipe <Packet <byte> >();
            Stream sut = packetsPipe.ToWriteOnlyStream();

            Task.Run(async() =>
            {
                await testData.CopyToAsync(sut);
                await sut.DisposeAsync(); // Closing/Disposing adapter triggers completion of producer by default.
            });


            FixedTestData.AssertStream(packetsPipe.ToReadOnlyStream());
            //FixedTestData.DebugStream(packetsPipe.ToReadOnlyStream());
        }