< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Tokens.SecurityKeyUsageHelper
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/SecurityKeyUsage.cs
Line coverage
66%
Covered lines: 4
Uncovered lines: 2
Coverable lines: 6
Total lines: 31
Line coverage: 66.6%
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.Primitives/src/CoreWCF/IdentityModel/Tokens/SecurityKeyUsage.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.IdentityModel.Tokens
 7{
 8    public enum SecurityKeyUsage
 9    {
 10        Exchange,
 11        Signature
 12    }
 13
 14    internal static class SecurityKeyUsageHelper
 15    {
 16        internal static bool IsDefined(SecurityKeyUsage value)
 17        {
 18618            return (value == SecurityKeyUsage.Exchange
 18619                || value == SecurityKeyUsage.Signature);
 20        }
 21
 22        internal static void Validate(SecurityKeyUsage value)
 23        {
 18624            if (!IsDefined(value))
 25            {
 026                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(value)
 027                    typeof(SecurityKeyUsage)));
 28            }
 18629        }
 30    }
 31}