< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.SecurityKeyEntropyModeHelper
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SecurityKeyEntropyMode.cs
Line coverage
71%
Covered lines: 5
Uncovered lines: 2
Coverable lines: 7
Total lines: 33
Line coverage: 71.4%
Branch coverage
83%
Covered branches: 5
Total branches: 6
Branch coverage: 83.3%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
IsDefined(...)75%44100%
Validate(...)50%2250%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SecurityKeyEntropyMode.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.ComponentModel;
 5
 6namespace CoreWCF.Security
 7{
 8    public enum SecurityKeyEntropyMode
 9    {
 10        ClientEntropy,
 11        ServerEntropy,
 12        CombinedEntropy
 13    }
 14
 15    internal sealed class SecurityKeyEntropyModeHelper
 16    {
 17        internal static bool IsDefined(SecurityKeyEntropyMode value)
 18        {
 2319            return (value == SecurityKeyEntropyMode.ClientEntropy
 2320                || value == SecurityKeyEntropyMode.ServerEntropy
 2321                || value == SecurityKeyEntropyMode.CombinedEntropy);
 22        }
 23
 24        internal static void Validate(SecurityKeyEntropyMode value)
 25        {
 2226            if (!IsDefined(value))
 27            {
 028                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(value)
 029                    typeof(SecurityKeyEntropyMode)));
 30            }
 2231        }
 32    }
 33}