< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.WSHttpSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/WSHttpSecurityElement.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/WSHttpSecurityElement.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 WSHttpSecurityElement : ServiceModelConfigurationElement
 9    {
 10        [ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = SecurityMode.Message)]
 11        public SecurityMode Mode
 12        {
 513            get { return (SecurityMode)base[ConfigurationStrings.Mode]; }
 014            set { base[ConfigurationStrings.Mode] = value; }
 15        }
 16
 17        [ConfigurationProperty(ConfigurationStrings.Transport)]
 18        public WSHttpTransportSecurityElement Transport
 19        {
 220            get { return (WSHttpTransportSecurityElement)base[ConfigurationStrings.Transport]; }
 21        }
 22
 23        [ConfigurationProperty(ConfigurationStrings.Message)]
 24        public NonDualMessageSecurityOverHttpElement Message
 25        {
 226            get { return (NonDualMessageSecurityOverHttpElement)base[ConfigurationStrings.Message]; }
 27        }
 28
 29        internal void ApplyConfiguration(WSHTTPSecurity security)
 30        {
 231            if (security == null)
 32            {
 033                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security));
 34            }
 35
 236            security.Mode = Mode;
 237            Transport.ApplyConfiguration(security.Transport);
 238            Message.ApplyConfiguration(security.Message);
 239        }
 40    }
 41}