コード例 #1
0
        public async Task DisposeAsyncCallsCompleteAsync()
        {
            var    pipeWriter = new TestPipeWriter();
            Stream stream     = pipeWriter.AsStream();

            await stream.DisposeAsync();

            Assert.True(pipeWriter.CompleteAsyncCalled);
        }
コード例 #2
0
        public async Task DefaultPipeWriterImplementationReturnsPipeWriterStream()
        {
            var    pipeWriter = new TestPipeWriter();
            Stream stream     = pipeWriter.AsStream();

            await stream.WriteAsync(new byte[10]);

            Assert.True(pipeWriter.WriteAsyncCalled);

            await stream.FlushAsync();

            Assert.True(pipeWriter.FlushCalled);
        }