< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.NamedServiceModelExtensionCollectionElement<T>
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NamedServiceModelExtensionCollectionElement.cs
Line coverage
92%
Covered lines: 13
Uncovered lines: 1
Coverable lines: 14
Total lines: 55
Line coverage: 92.8%
Branch coverage
83%
Covered branches: 5
Total branches: 6
Branch coverage: 83.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)50%2280%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NamedServiceModelExtensionCollectionElement.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.Configuration;
 6
 7namespace CoreWCF.Configuration
 8{
 9    public abstract class NamedServiceModelExtensionCollectionElement<TServiceModelExtensionElement> : ServiceModelExten
 10        where TServiceModelExtensionElement : ServiceModelExtensionElement
 11    {
 12        private ConfigurationPropertyCollection _properties = null;
 13
 14        protected NamedServiceModelExtensionCollectionElement(string extensionCollectionName, string name)
 2015            : base(extensionCollectionName)
 16        {
 2017            if (!string.IsNullOrEmpty(name))
 18            {
 019                Name = name;
 20            }
 21            else
 22            {
 2023                Name = string.Empty;
 24            }
 2025        }
 26
 27        [ConfigurationProperty(ConfigurationStrings.Name, Options = ConfigurationPropertyOptions.IsKey)]
 28        [StringValidator(MinLength = 0)]
 29        public string Name
 30        {
 8031            get { return (string)base[ConfigurationStrings.Name]; }
 32            set
 33            {
 2034                if (string.IsNullOrEmpty(value))
 35                {
 2036                    value = string.Empty;
 37                }
 2038                base[ConfigurationStrings.Name] = value;
 2039            }
 40        }
 41
 42        protected override ConfigurationPropertyCollection Properties
 43        {
 44            get
 45            {
 26946                if (_properties == null)
 47                {
 2048                    _properties = base.Properties;
 2049                    _properties.Add(new ConfigurationProperty(ConfigurationStrings.Name, typeof(string), null, null, new
 50                }
 26951                return _properties;
 52            }
 53        }
 54    }
 55}