< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.NetTcpSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NetTcpSecurityElement.cs
Line coverage
80%
Covered lines: 8
Uncovered lines: 2
Coverable lines: 10
Total lines: 41
Line coverage: 80%
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
ApplyConfiguration(...)50%2283.33%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/NetTcpSecurityElement.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    public class NetTcpSecurityElement : ServiceModelConfigurationElement
 9    {
 10        [ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = SecurityMode.Transport)]
 11        public SecurityMode Mode
 12        {
 1813            get { return (SecurityMode)base[ConfigurationStrings.Mode]; }
 014            set { base[ConfigurationStrings.Mode] = value; }
 15        }
 16
 17        [ConfigurationProperty(ConfigurationStrings.Transport)]
 18        public TcpTransportSecurityElement Transport
 19        {
 920            get { return (TcpTransportSecurityElement)base[ConfigurationStrings.Transport]; }
 21        }
 22
 23        [ConfigurationProperty(ConfigurationStrings.Message)]
 24        public MessageSecurityOverTcpElement Message
 25        {
 926            get { return (MessageSecurityOverTcpElement)base[ConfigurationStrings.Message]; }
 27        }
 28
 29        internal void ApplyConfiguration(NetTcpSecurity security)
 30        {
 931            if (security == null)
 32            {
 033                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security));
 34            }
 35
 936            security.Mode = Mode;
 937            Transport.ApplyConfiguration(security.Transport);
 938            Message.ApplyConfiguration(security.Message);
 939        }
 40    }
 41}