< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.IdentityModel.EncryptionMethodElement
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/EncryptionMethodElement.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 62
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ReadXml(...)0%660%
WriteXml(...)100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/IdentityModel/EncryptionMethodElement.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.Xml;
 5
 6namespace CoreWCF.IdentityModel
 7{
 8    internal class EncryptionMethodElement
 9    {
 010        public string Algorithm { get; set; }
 11
 012        public string Parameters { get; set; }
 13
 14        public void ReadXml( XmlDictionaryReader reader )
 15        {
 016            if ( reader == null )
 17            {
 018                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull( nameof(reader));
 19            }
 20
 021            reader.MoveToContent();
 022            if ( !reader.IsStartElement( XmlEncryptionConstants.Elements.EncryptionMethod, XmlEncryptionConstants.Namesp
 23            {
 024                return;
 25            }
 26
 027            Algorithm = reader.GetAttribute( XmlEncryptionConstants.Attributes.Algorithm, null );
 28
 029            if ( !reader.IsEmptyElement )
 30            {
 31                //
 32                // Trace unread missing element
 33                //
 34
 035                string xml = reader.ReadOuterXml();
 36                //if ( DiagnosticUtility.ShouldTraceWarning )
 37                //{
 38                //    TraceUtility.TraceString( System.Diagnostics.TraceEventType.Warning, SR.GetString( SR.ID8024, read
 39                //}
 40            }
 41            else
 42            {
 43                //
 44                // Read to the next element
 45                //
 046                reader.Read();
 47            }
 048        }
 49
 50        public void WriteXml( XmlWriter writer )
 51        {
 052            writer.WriteStartElement( XmlEncryptionConstants.Prefix, XmlEncryptionConstants.Elements.EncryptionMethod, X
 53
 054            writer.WriteAttributeString( XmlEncryptionConstants.Attributes.Algorithm, null, Algorithm );
 55
 56            // <EncryptionMethod>
 57
 058            writer.WriteEndElement();
 059        }
 60
 61    }
 62}