コード例 #1
0
        public void InnerStreamIsNotFlushedOnDispose()
        {
            var stream = FlushReportingStream.GetThrowingStream();
            var nonDisposableStream = new NonDisposableStream(stream);

            // Act & Assert
            nonDisposableStream.Dispose();
        }
コード例 #2
0
        public async Task InnerStreamIsNotFlushedOnFlushAsync()
        {
            // Arrange
            var stream = FlushReportingStream.GetThrowingStream();

            var nonDisposableStream = new NonDisposableStream(stream);

            // Act & Assert
            await nonDisposableStream.FlushAsync();
        }
コード例 #3
0
        public void InnerStreamIsOpenOnDispose()
        {
            // Arrange
            var innerStream         = new MemoryStream();
            var nonDisposableStream = new NonDisposableStream(innerStream);

            // Act
            nonDisposableStream.Dispose();

            // Assert
            Assert.True(innerStream.CanRead);
        }