< Summary - CoreWCF Coverage — PR #1766

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
IsDefined(...)0%220%
Validate(...)0%220%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.UnixDomainSocket/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        {
 014            SslProtocols allValues = SslProtocols.None;
 015            foreach (object protocol in Enum.GetValues(typeof(SslProtocols)))
 16            {
 017                allValues |= (SslProtocols)protocol;
 18            }
 019            return (value & allValues) == value;
 20        }
 21
 22        internal static void Validate(SslProtocols value)
 23        {
 024            if (!IsDefined(value))
 25            {
 026                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(value)
 027                    typeof(SslProtocols)));
 28            }
 029        }
 30    }
 31}