< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.UriHelper
Assembly: CoreWCF.NetTcp
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Channels/UriHelper.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 38
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ValidateBaseAddress(...)0%10100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Channels/UriHelper.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5
 6namespace CoreWCF.Channels
 7{
 8    internal static class UriHelper
 9    {
 10        internal static void ValidateBaseAddress(Uri uri, string argumentName)
 11        {
 012            if (uri == null)
 13            {
 014                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(argumentName);
 15            }
 16
 017            if (!uri.IsAbsoluteUri)
 18            {
 019                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(argumentName, SR.BaseAddressMustBeAbsolute)
 20            }
 21
 022            if (!string.IsNullOrEmpty(uri.UserInfo))
 23            {
 024                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(argumentName, SR.BaseAddressCannotHaveUserI
 25            }
 26
 027            if (!string.IsNullOrEmpty(uri.Query))
 28            {
 029                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(argumentName, SR.BaseAddressCannotHaveQuery
 30            }
 31
 032            if (!string.IsNullOrEmpty(uri.Fragment))
 33            {
 034                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(argumentName, SR.BaseAddressCannotHaveFragm
 35            }
 036        }
 37    }
 38}