< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Security.SecurityContextKeyIdentifierClause
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SecurityContextKeyIdentifierClause.cs
Line coverage
60%
Covered lines: 9
Uncovered lines: 6
Coverable lines: 15
Total lines: 50
Line coverage: 60%
Branch coverage
25%
Covered branches: 2
Total branches: 8
Branch coverage: 25%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
.ctor(...)100%11100%
.ctor(...)50%22100%
Matches(...)0%440%
Matches(...)50%22100%
ToString()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/Security/SecurityContextKeyIdentifierClause.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.Globalization;
 5using CoreWCF.IdentityModel;
 6using UniqueId = System.Xml.UniqueId;
 7
 8namespace CoreWCF.Security
 9{
 10    public class SecurityContextKeyIdentifierClause : SecurityKeyIdentifierClause
 11    {
 12        public SecurityContextKeyIdentifierClause(UniqueId contextId)
 013            : this(contextId, null)
 14        {
 015        }
 16
 17        public SecurityContextKeyIdentifierClause(UniqueId contextId, UniqueId generation)
 2018            : this(contextId, generation, null, 0)
 19        {
 2020        }
 21
 22        public SecurityContextKeyIdentifierClause(UniqueId contextId, UniqueId generation, byte[] derivationNonce, int d
 3023            : base(null, derivationNonce, derivationLength)
 24        {
 3025            ContextId = contextId ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(contextId))
 3026            Generation = generation;
 3027        }
 28
 2029        public UniqueId ContextId { get; }
 30
 2031        public UniqueId Generation { get; }
 32
 33        public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
 34        {
 035            SecurityContextKeyIdentifierClause that = keyIdentifierClause as SecurityContextKeyIdentifierClause;
 036            return ReferenceEquals(this, that) || (that != null && that.Matches(ContextId, Generation));
 37        }
 38
 39        public bool Matches(UniqueId contextId, UniqueId generation)
 40        {
 1041            return contextId == ContextId && generation == Generation;
 42        }
 43
 44        public override string ToString()
 45        {
 046            return string.Format(CultureInfo.InvariantCulture, "SecurityContextKeyIdentifierClause(ContextId = '{0}', Ge
 047                ContextId, Generation);
 48        }
 49    }
 50}