< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Configuration.WindowsStreamSecurityElement
Assembly: CoreWCF.ConfigurationManager
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/WindowsStreamSecurityElement.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 23
Coverable lines: 23
Total lines: 62
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
ApplyConfiguration(...)100%110%
CreateBindingElement()100%110%
CopyFrom(...)100%110%
InitializeFrom(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.ConfigurationManager/src/CoreWCF/Configuration/WindowsStreamSecurityElement.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;
 6using System.Net.Security;
 7using CoreWCF.Channels;
 8
 9namespace CoreWCF.Configuration
 10{
 11    public sealed class WindowsStreamSecurityElement : BindingElementExtensionElement
 12    {
 013        public WindowsStreamSecurityElement()
 14        {
 015        }
 16
 17        [ConfigurationProperty(ConfigurationStrings.ProtectionLevel, DefaultValue = ConnectionOrientedTransportDefaults.
 18        public ProtectionLevel ProtectionLevel
 19        {
 020            get { return (ProtectionLevel)base[ConfigurationStrings.ProtectionLevel]; }
 021            set { base[ConfigurationStrings.ProtectionLevel] = value; }
 22        }
 23
 24        public override void ApplyConfiguration(BindingElement bindingElement)
 25        {
 026            base.ApplyConfiguration(bindingElement);
 027            WindowsStreamSecurityBindingElement windowsBindingElement =
 028                (WindowsStreamSecurityBindingElement)bindingElement;
 029            windowsBindingElement.ProtectionLevel = ProtectionLevel;
 030        }
 31
 32        protected internal override BindingElement CreateBindingElement()
 33        {
 034            WindowsStreamSecurityBindingElement windowsBindingElement
 035                = new WindowsStreamSecurityBindingElement();
 36
 037            ApplyConfiguration(windowsBindingElement);
 038            return windowsBindingElement;
 39        }
 40
 41        public override Type BindingElementType
 42        {
 043            get { return typeof(WindowsStreamSecurityBindingElement); }
 44        }
 45
 46        public override void CopyFrom(ServiceModelExtensionElement from)
 47        {
 048            base.CopyFrom(from);
 49
 050            WindowsStreamSecurityElement source = (WindowsStreamSecurityElement)from;
 051            ProtectionLevel = source.ProtectionLevel;
 052        }
 53
 54        protected internal override void InitializeFrom(BindingElement bindingElement)
 55        {
 056            base.InitializeFrom(bindingElement);
 057            WindowsStreamSecurityBindingElement windowsBindingElement
 058                = (WindowsStreamSecurityBindingElement)bindingElement;
 059            SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectionLevel, windowsBindingElement.ProtectionLeve
 060        }
 61    }
 62}