< Summary

Class:Azure.Storage.StorageProgressExtensions
Assembly:Azure.Storage.Files.Shares
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\StorageProgressExtensions.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:31
Line coverage:83.3% (5 of 6)
Covered branches:5
Total branches:6
Branch coverage:83.3% (5 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
WithProgress(...)-83.33%83.33%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.IO;
 6
 7namespace Azure.Storage
 8{
 9    internal static class StorageProgressExtensions
 10    {
 11        public static Stream WithProgress(this Stream stream, IProgress<long> progressHandler)
 12        {
 130013            if (progressHandler != null && stream != null)
 14            {
 215                if (progressHandler is AggregatingProgressIncrementer handler)
 16                {
 017                    return handler.CreateProgressIncrementingStream(stream);
 18                }
 19                else
 20                {
 221                    return (new AggregatingProgressIncrementer(progressHandler))
 222                        .CreateProgressIncrementingStream(stream);
 23                }
 24            }
 25            else
 26            {
 129827                return stream;
 28            }
 29        }
 30    }
 31}

Methods/Properties

WithProgress(...)