< Summary

Class:Azure.Storage.StorageProgressExtensions
Assembly:Azure.Storage.Blobs
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        {
 525213            if (progressHandler != null && stream != null)
 14            {
 1615                if (progressHandler is AggregatingProgressIncrementer handler)
 16                {
 017                    return handler.CreateProgressIncrementingStream(stream);
 18                }
 19                else
 20                {
 1621                    return (new AggregatingProgressIncrementer(progressHandler))
 1622                        .CreateProgressIncrementingStream(stream);
 23                }
 24            }
 25            else
 26            {
 523627                return stream;
 28            }
 29        }
 30    }
 31}

Methods/Properties

WithProgress(...)