< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.TcpTransportSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/TcpTransportSecurityElement.cs
Line coverage
66%
Covered lines: 6
Uncovered lines: 3
Coverable lines: 9
Total lines: 54
Line coverage: 66.6%
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%2280%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/TcpTransportSecurityElement.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;
 5using System.Security.Authentication;
 6using CoreWCF.Channels;
 7
 8namespace CoreWCF.Configuration
 9{
 10    public class TcpTransportSecurityElement : ServiceModelConfigurationElement
 11    {
 12        [ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = TcpClientCredentialType.Windows
 13        public TcpClientCredentialType ClientCredentialType
 14        {
 915            get { return (TcpClientCredentialType)base[ConfigurationStrings.ClientCredentialType]; }
 016            set { base[ConfigurationStrings.ClientCredentialType] = value; }
 17        }
 18
 19        //[ConfigurationProperty(ConfigurationStrings.ProtectionLevel, DefaultValue = TcpTransportSecurity.DefaultProtec
 20        //[ServiceModelEnumValidator(typeof(ProtectionLevelHelper))]
 21        //public ProtectionLevel ProtectionLevel
 22        //{
 23        //    get { return (ProtectionLevel)base[ConfigurationStrings.ProtectionLevel]; }
 24        //    set { base[ConfigurationStrings.ProtectionLevel] = value; }
 25        //}
 26
 27        //[ConfigurationProperty(ConfigurationStrings.ExtendedProtectionPolicy)]
 28        //public ExtendedProtectionPolicyElement ExtendedProtectionPolicy
 29        //{
 30        //    get { return (ExtendedProtectionPolicyElement)base[ConfigurationStrings.ExtendedProtectionPolicy]; }
 31        //    private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; }
 32        //}
 33
 34        [ConfigurationProperty(ConfigurationStrings.SslProtocols, DefaultValue = SslProtocols.None)]
 35        public SslProtocols SslProtocols
 36        {
 937            get { return (SslProtocols)base[ConfigurationStrings.SslProtocols]; }
 038            private set { base[ConfigurationStrings.SslProtocols] = value; }
 39        }
 40
 41        internal void ApplyConfiguration(TcpTransportSecurity security)
 42        {
 943            if (security == null)
 44            {
 045                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security));
 46            }
 47
 948            security.ClientCredentialType = ClientCredentialType;
 49            //security.ProtectionLevel = this.ProtectionLevel;
 50            //security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
 951            security.SslProtocols = SslProtocols;
 952        }
 53    }
 54}