< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.ClientClassGenerator
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/ClientClassGenerator.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 33
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
GetClientClassName(...)100%11100%
GetClassName(...)100%66100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/ClientClassGenerator.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.Description
 7{
 8    internal static class ClientClassGenerator
 9    {
 10        internal static string GetClientClassName(string interfaceName)
 11        {
 2512            return GetClassName(interfaceName) + Strings.ClientTypeSuffix;
 13        }
 14
 15        private static string GetClassName(string interfaceName)
 16        {
 17            // maybe strip a leading 'I'
 2518            if (interfaceName.Length >= 2 &&
 2519                string.Compare(interfaceName, 0, Strings.InterfaceTypePrefix, 0, Strings.InterfaceTypePrefix.Length, Str
 2520                char.IsUpper(interfaceName, 1))
 1821                return interfaceName.Substring(1);
 22            else
 723                return interfaceName;
 24        }
 25
 26        private static class Strings
 27        {
 28            public const string ClientBaseChannelProperty = "Channel";
 29            public const string ClientTypeSuffix = "Client";
 30            public const string InterfaceTypePrefix = "I";
 31        }
 32    }
 33}