< Summary

Class:Azure.Storage.NonDisposingStream
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\NonDisposingStream.cs
Covered lines:8
Uncovered lines:8
Coverable lines:16
Total lines:53
Line coverage:50% (8 of 16)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_CanRead()-100%100%
get_CanSeek()-100%100%
get_CanWrite()-0%100%
CopyToAsync(...)-100%100%
get_Length()-100%100%
get_Position()-0%100%
Flush()-0%100%
FlushAsync(...)-0%100%
Read(...)-100%100%
ReadAsync(...)-100%100%
Seek(...)-100%100%
SetLength(...)-0%100%
Write(...)-0%100%
WriteAsync(...)-0%100%
Dispose(...)-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\NonDisposingStream.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.IO;
 5using System.Threading;
 6using System.Threading.Tasks;
 7
 8#pragma warning disable SA1402  // File may only contain a single type
 9
 10namespace Azure.Storage
 11{
 12    internal class NonDisposingStream : Stream
 13    {
 14        private readonly Stream _innerStream;
 15
 260016        public NonDisposingStream(Stream innerStream) => _innerStream = innerStream;
 17
 218        public override bool CanRead => _innerStream.CanRead;
 19
 390220        public override bool CanSeek => _innerStream.CanSeek;
 21
 022        public override bool CanWrite => _innerStream.CanWrite;
 23
 127224        public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken) => _in
 25
 390226        public override long Length => _innerStream.Length;
 27
 028        public override long Position { get => _innerStream.Position; set => _innerStream.Position = value; }
 29
 030        public override void Flush() => _innerStream.Flush();
 31
 032        public override Task FlushAsync(CancellationToken cancellationToken) => _innerStream.FlushAsync(cancellationToke
 33
 276234        public override int Read(byte[] buffer, int offset, int count) => _innerStream.Read(buffer, offset, count);
 35
 1236        public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) =
 37
 260238        public override long Seek(long offset, SeekOrigin origin) => _innerStream.Seek(offset, origin);
 39
 040        public override void SetLength(long value) => _innerStream.SetLength(value);
 41
 042        public override void Write(byte[] buffer, int offset, int count) => _innerStream.Write(buffer, offset, count);
 43
 044        public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) => _i
 45
 046        protected override void Dispose(bool disposing) { /* swallow disposal */ }
 47    }
 48
 49    internal static partial class StreamExtensions
 50    {
 51        public static Stream WithNoDispose(this Stream stream) => stream is NonDisposingStream ? stream : new NonDisposi
 52    }
 53}