< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.ServiceElementCollection
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/ServiceElementCollection.cs
Line coverage
75%
Covered lines: 3
Uncovered lines: 1
Coverable lines: 4
Total lines: 26
Line coverage: 75%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
CreateNewElement()100%11100%
GetElementKey(...)50%2266.66%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/ServiceElementCollection.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.Configuration;
 5
 6namespace CoreWCF.Configuration
 7{
 8    [ConfigurationCollection(typeof(ServiceElement), AddItemName = ConfigurationStrings.Service)]
 9    public class ServiceElementCollection : ConfigurationElementCollection
 10    {
 11        protected override ConfigurationElement CreateNewElement()
 12        {
 1213            return new ServiceElement();
 14        }
 15
 16        protected override object GetElementKey(ConfigurationElement element)
 17        {
 3818            if (element == null)
 19            {
 020                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(element));
 21            }
 22
 3823            return ((ServiceElement)element).Name;
 24        }
 25    }
 26}