< Summary

Class:Azure.Storage.Shared.StorageExtensions
Assembly:Azure.Storage.Files.DataLake
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\StorageExtensions.cs
Covered lines:12
Uncovered lines:2
Coverable lines:14
Total lines:48
Line coverage:85.7% (12 of 14)
Covered branches:6
Total branches:8
Branch coverage:75% (6 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
EscapePath(...)-85.71%75%
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        {
 910814            if (path == null)
 15            {
 016                return null;
 17            }
 18
 910819            path = path.Trim('/');
 910820            string[] split = path.Split('/');
 21
 3908822            for (int i = 0; i < split.Length; i++)
 23            {
 1043624                split[i] = Uri.EscapeDataString(split[i]);
 25            }
 26
 910827            return string.Join("/", split);
 28        }
 29
 30        public static string UnescapePath(this string path)
 31        {
 235232            if (path == null)
 33            {
 034                return null;
 35            }
 36
 235237            path = path.Trim('/');
 235238            string[] split = path.Split('/');
 39
 989640            for (int i = 0; i < split.Length; i++)
 41            {
 259642                split[i] = Uri.UnescapeDataString(split[i]);
 43            }
 44
 235245            return string.Join("/", split);
 46        }
 47    }
 48}

Methods/Properties

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