< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.HttpTransportSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/HttpTransportSecurityElement.cs
Line coverage
50%
Covered lines: 6
Uncovered lines: 6
Coverable lines: 12
Total lines: 52
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/HttpTransportSecurityElement.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 class HttpTransportSecurityElement : ServiceModelConfigurationElement
 10    {
 11        [ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = HttpClientCredentialType.None)]
 12        public HttpClientCredentialType ClientCredentialType
 13        {
 814            get { return (HttpClientCredentialType)base[ConfigurationStrings.ClientCredentialType]; }
 015            set { base[ConfigurationStrings.ClientCredentialType] = value; }
 16        }
 17
 18        //[ConfigurationProperty(ConfigurationStrings.ExtendedProtectionPolicy)]
 19        //public ExtendedProtectionPolicyElement ExtendedProtectionPolicy
 20        //{
 21        //    get { return (ExtendedProtectionPolicyElement)base[ConfigurationStrings.ExtendedProtectionPolicy]; }
 22        //    private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; }
 23        //}
 24
 25        [ConfigurationProperty(ConfigurationStrings.Realm, DefaultValue = "")]
 26        [StringValidator(MinLength = 0)]
 27        public string Realm
 28        {
 829            get { return (string)base[ConfigurationStrings.Realm]; }
 30            set
 31            {
 032                if (String.IsNullOrEmpty(value))
 33                {
 034                    value = String.Empty;
 35                }
 036                base[ConfigurationStrings.Realm] = value;
 037            }
 38        }
 39
 40        internal void ApplyConfiguration(HttpTransportSecurity security)
 41        {
 842            if (security == null)
 43            {
 044                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security));
 45            }
 46
 847            security.ClientCredentialType = ClientCredentialType;
 848            security.Realm = Realm;
 49           // security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy);
 850        }
 51    }
 52}