< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Description.ConfigLoader
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/ConfigLoader.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 44
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
LookupContract(...)0%440%
LookupContractForStandardEndpoint(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Description/ConfigLoader.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;
 5using System.Collections.Generic;
 6using CoreWCF.Channels;
 7
 8namespace CoreWCF.Description
 9{
 10    internal class ConfigLoader
 11    {
 12        private readonly Dictionary<string, Binding> _bindingTable;
 13        private readonly IContractResolver _contractResolver;
 14
 015        public ConfigLoader(IContractResolver contractResolver)
 16        {
 017            _contractResolver = contractResolver;
 018            _bindingTable = new Dictionary<string, Binding>();
 019        }
 20
 21        internal ContractDescription LookupContract(string contractName, string serviceName)
 22        {
 023            ContractDescription contract = LookupContractForStandardEndpoint(contractName, serviceName);
 024            if (contract == null)
 25            {
 026                if (contractName == string.Empty)
 27                {
 028                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR
 29                }
 30                else
 31                {
 032                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.Format(SR
 33                }
 34            }
 35
 036            return contract;
 37        }
 38
 39        internal ContractDescription LookupContractForStandardEndpoint(string contractName, string serviceName)
 40        {
 041            return _contractResolver.ResolveContract(contractName);
 42        }
 43    }
 44}