< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.Protocols.WSTrust.RequestedSecurityToken
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/RequestedSecurityToken.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 12
Coverable lines: 12
Total lines: 74
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
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(...)0%220%
.ctor(...)0%220%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/Tokens/RequestedSecurityToken.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 CoreWCF.IdentityModel.Tokens;
 5using System.Xml;
 6
 7namespace CoreWCF.IdentityModel.Protocols.WSTrust
 8{
 9    /// <summary>
 10    /// This class defines the requested security token which is usually opaque to
 11    /// the token requestor.
 12    /// </summary>
 13    public class RequestedSecurityToken
 14    {
 15        private XmlElement _tokenAsXml;
 16        private SecurityToken _requestedToken;
 17
 18        /// <summary>
 19        /// Creates an instance of RequestedSecurityToken using the issued token. This is usually used
 20        /// on the token issuer end.
 21        /// </summary>
 22        /// <param name="token">The Security token requested.</param>
 023        public RequestedSecurityToken(SecurityToken token)
 24        {
 025            if (token == null)
 26            {
 027                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(token));
 28            }
 29
 030            _requestedToken = token;
 031        }
 32
 33        /// <summary>
 34        /// Creates an instance of RequestedSecurityToken using the token xml. This is usually used on the
 35        /// token receiving end.
 36        /// </summary>
 37        /// <param name="tokenAsXml">XML representation of the token.</param>
 038        public RequestedSecurityToken(XmlElement tokenAsXml)
 39        {
 040            if (tokenAsXml == null)
 41            {
 042                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenAsXml));
 43            }
 44
 045            _tokenAsXml = tokenAsXml;
 046        }
 47
 48        /// <summary>
 49        /// Returns the XML representation of the token when the RequestedSecurityToken was constructed
 50        /// using the token xml. This property getter could return null if the RequestedSecurityToken was constructed
 51        /// using a security token.
 52        /// </summary>
 53        public virtual XmlElement SecurityTokenXml
 54        {
 55            get
 56            {
 057                return _tokenAsXml;
 58            }
 59        }
 60
 61        /// <summary>
 62        /// Gets the issued security token when the RequestedSecurityToken was constructed using the token
 63        /// itself. This property getter could return null if the RequestedSecurityToken was constructed using the
 64        /// token xml.
 65        /// </summary>
 66        public SecurityToken SecurityToken
 67        {
 68            get
 69            {
 070                return _requestedToken;
 71            }
 72        }
 73    }
 74}