< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.WSHttpTransportSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/WSHttpTransportSecurityElement.cs
Line coverage
50%
Covered lines: 6
Uncovered lines: 6
Coverable lines: 12
Total lines: 51
Line coverage: 50%
Branch coverage
25%
Covered branches: 1
Total branches: 4
Branch coverage: 25%
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/WSHttpTransportSecurityElement.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 WSHttpTransportSecurityElement : ServiceModelConfigurationElement
 9    {
 10        [ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = HttpClientCredentialType.Window
 11        public HttpClientCredentialType ClientCredentialType
 12        {
 213            get { return (HttpClientCredentialType)base[ConfigurationStrings.ClientCredentialType]; }
 014            set { base[ConfigurationStrings.ClientCredentialType] = value; }
 15        }
 16
 17        //[ConfigurationProperty(ConfigurationStrings.ExtendedProtectionPolicy)]
 18        //public ExtendedProtectionPolicyElement ExtendedProtectionPolicy
 19        //{
 20        //    get { return (ExtendedProtectionPolicyElement)base[ConfigurationStrings.ExtendedProtectionPolicy]; }
 21        //    private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; }
 22        //}
 23
 24        [ConfigurationProperty(ConfigurationStrings.Realm, DefaultValue = "")]
 25        [StringValidator(MinLength = 0)]
 26        public string Realm
 27        {
 228            get { return (string)base[ConfigurationStrings.Realm]; }
 29            set
 30            {
 031                if (string.IsNullOrEmpty(value))
 32                {
 033                    value = string.Empty;
 34                }
 035                base[ConfigurationStrings.Realm] = value;
 036            }
 37        }
 38
 39        internal void ApplyConfiguration(HttpTransportSecurity security)
 40        {
 241            if (security == null)
 42            {
 043                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security));
 44            }
 45
 246            security.ClientCredentialType = ClientCredentialType;
 247            security.Realm = Realm;
 48           // security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
 249        }
 50    }
 51}