< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.SecurityHeaderLayoutHelper
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/SecurityHeaderLayout.cs
Line coverage
75%
Covered lines: 6
Uncovered lines: 2
Coverable lines: 8
Total lines: 35
Line coverage: 75%
Branch coverage
87%
Covered branches: 7
Total branches: 8
Branch coverage: 87.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

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

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Channels/SecurityHeaderLayout.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.Channels
 7{
 8    public enum SecurityHeaderLayout
 9    {
 10        Strict = 0,
 11        Lax = 1,
 12        LaxTimestampFirst = 2,
 13        LaxTimestampLast = 3
 14    }
 15
 16    internal static class SecurityHeaderLayoutHelper
 17    {
 18        public static bool IsDefined(SecurityHeaderLayout value)
 19        {
 16520            return (value == SecurityHeaderLayout.Lax
 16521            || value == SecurityHeaderLayout.LaxTimestampFirst
 16522            || value == SecurityHeaderLayout.LaxTimestampLast
 16523            || value == SecurityHeaderLayout.Strict);
 24        }
 25
 26        public static void Validate(SecurityHeaderLayout value)
 27        {
 9428            if (!IsDefined(value))
 29            {
 030                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException(nameof(value)
 031                    typeof(SecurityHeaderLayout)));
 32            }
 9433        }
 34    }
 35}