< Summary

Class:Azure.Storage.Shared.StorageExtensions
Assembly:Azure.Storage.Blobs
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\StorageExtensions.cs
Covered lines:6
Uncovered lines:8
Coverable lines:14
Total lines:48
Line coverage:42.8% (6 of 14)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
EscapePath(...)-0%0%
UnescapePath(...)-85.71%75%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Text;
 7
 8namespace Azure.Storage.Shared
 9{
 10    internal static class StorageExtensions
 11    {
 12        public static string EscapePath(this string path)
 13        {
 014            if (path == null)
 15            {
 016                return null;
 17            }
 18
 019            path = path.Trim('/');
 020            string[] split = path.Split('/');
 21
 022            for (int i = 0; i < split.Length; i++)
 23            {
 024                split[i] = Uri.EscapeDataString(split[i]);
 25            }
 26
 027            return string.Join("/", split);
 28        }
 29
 30        public static string UnescapePath(this string path)
 31        {
 74832            if (path == null)
 33            {
 034                return null;
 35            }
 36
 74837            path = path.Trim('/');
 74838            string[] split = path.Split('/');
 39
 299240            for (int i = 0; i < split.Length; i++)
 41            {
 74842                split[i] = Uri.UnescapeDataString(split[i]);
 43            }
 44
 74845            return string.Join("/", split);
 46        }
 47    }
 48}

Methods/Properties

EscapePath(...)
UnescapePath(...)