< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Tokens.Saml.EncryptedKey
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/Saml/EncryptedKey.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 18
Coverable lines: 18
Total lines: 56
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
Equals(...)0%10100%
GetHashCode()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/Saml/EncryptedKey.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;
 5
 6namespace CoreWCF.IdentityModel.Tokens.Saml
 7{
 8    /// <summary>
 9    /// Represents the EncryptedKey Element of X509Data as per:  https://www.w3.org/TR/2001/PR-xmldsig-core-20010820/#se
 10    /// </summary>
 11    public class EncryptedKey
 12    {
 13        /// <summary>
 14        /// Creates an EncryptedKey
 15        /// </summary>
 016        public EncryptedKey(string encryptionMethod, Microsoft.IdentityModel.Xml.KeyInfo keyInfo, string cipherData)
 17        {
 018            EncryptionMethod = encryptionMethod;
 019            KeyInfo = keyInfo;
 020            CipherData = cipherData;
 021        }
 22
 23        /// <summary>
 24        /// Gets the SecurityKeyIdentifier
 25        /// </summary>
 026        public string EncryptionMethod { get; }
 27
 28        /// <summary>
 29        /// encryptedKey
 30        /// </summary>
 031        public Microsoft.IdentityModel.Xml.KeyInfo KeyInfo { get; }
 32
 33        /// <summary>
 34        ///
 35        /// </summary>
 036        public string CipherData { get; }
 37
 38        public override bool Equals(object obj)
 39        {
 040            if (obj is not EncryptedKey other)
 041                return false;
 042            if (other is null)
 043                return false;
 044            if (ReferenceEquals(this, other))
 045                return true;
 046            return string.Equals(EncryptionMethod, other.EncryptionMethod) &&
 047                   Equals(KeyInfo, other.KeyInfo) &&
 048                   string.Equals(CipherData, other.CipherData);
 49        }
 50
 51        public override int GetHashCode()
 52        {
 053            return HashCode.Combine(EncryptionMethod, KeyInfo, CipherData);
 54        }
 55    }
 56}