< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.SslProtocolsHelper
Assembly: CoreWCF.NetTcp
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Security/SslProtocolsHelper.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 31
Line coverage: 75%
Branch coverage
75%
Covered branches: 3
Total branches: 4
Branch coverage: 75%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
IsDefined(...)100%22100%
Validate(...)50%2250%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.NetTcp/src/CoreWCF/Security/SslProtocolsHelper.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.Security.Authentication;
 7
 8namespace CoreWCF.Security
 9{
 10    internal static class SslProtocolsHelper
 11    {
 12        internal static bool IsDefined(SslProtocols value)
 13        {
 1014            SslProtocols allValues = SslProtocols.None;
 18015            foreach (object protocol in Enum.GetValues(typeof(SslProtocols)))
 16            {
 8017                allValues |= (SslProtocols)protocol;
 18            }
 1019            return (value & allValues) == value;
 20        }
 21
 22        internal static void Validate(SslProtocols value)
 23        {
 1024            if (!IsDefined(value))
 25            {
 026                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(value)
 027                    typeof(SslProtocols)));
 28            }
 1029        }
 30    }
 31}