< Summary

Class:Microsoft.Azure.KeyVault.UriExtensions
Assembly:Microsoft.Azure.KeyVault
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Customized\UriExtensions.cs
Covered lines:4
Uncovered lines:0
Coverable lines:4
Total lines:30
Line coverage:100% (4 of 4)
Covered branches:4
Total branches:4
Branch coverage:100% (4 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
FullAuthority(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault\src\Customized\UriExtensions.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5using System;
 6
 7namespace Microsoft.Azure.KeyVault
 8{
 9    internal static class UriExtensions
 10    {
 11        /// <summary>
 12        /// Returns an authority string for URI that is guaranteed to contain
 13        /// a port number.
 14        /// </summary>
 15        /// <param name="uri">The Uri from which to compute the authority</param>
 16        /// <returns>The complete authority for the Uri</returns>
 17        public static string FullAuthority(this Uri uri)
 18        {
 56819            string authority = uri.Authority;
 20
 56821            if (!authority.Contains(":") && uri.Port > 0)
 22            {
 23                // Append port for complete authority
 56824                authority = string.Format("{0}:{1}", uri.Authority, uri.Port.ToString());
 25            }
 26
 56827            return authority;
 28        }
 29    }
 30}

Methods/Properties

FullAuthority(...)