< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.NamedPipeTransportSecurity
Assembly: CoreWCF.NetNamedPipe
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/NamedPipeTransportSecurity.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 45
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
CreateTransportProtectionAndAuthentication()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetNamedPipe/src/CoreWCF/NamedPipeTransportSecurity.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.ComponentModel;
 6using System.Net.Security;
 7using System.Runtime.Versioning;
 8using CoreWCF.Channels;
 9using CoreWCF.Security;
 10
 11namespace CoreWCF
 12{
 13    [SupportedOSPlatform("windows")]
 14    public sealed class NamedPipeTransportSecurity
 15    {
 16        internal const ProtectionLevel DefaultProtectionLevel = ProtectionLevel.EncryptAndSign;
 17        private ProtectionLevel _protectionLevel;
 18
 019        public NamedPipeTransportSecurity()
 20        {
 021            _protectionLevel = DefaultProtectionLevel;
 022        }
 23
 24        [DefaultValue(ConnectionOrientedTransportDefaults.ProtectionLevel)]
 25        public ProtectionLevel ProtectionLevel
 26        {
 027            get { return _protectionLevel; }
 28            set
 29            {
 030                if (!ProtectionLevelHelper.IsDefined(value))
 31                {
 032                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException(nameof(val
 33                }
 034                _protectionLevel = value;
 035            }
 36        }
 37
 38        internal WindowsStreamSecurityBindingElement CreateTransportProtectionAndAuthentication()
 39        {
 040            WindowsStreamSecurityBindingElement result = new WindowsStreamSecurityBindingElement();
 041            result.ProtectionLevel = _protectionLevel;
 042            return result;
 43        }
 44    }
 45}