< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.XmlReaderExtensions
Assembly: CoreWCF.Primitives
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/XmlReaderExtensions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 32
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 12
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ReadElementString(...)0%660%
ReadElementString(...)0%660%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.Primitives/src/CoreWCF/XmlReaderExtensions.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
 7{
 8    internal static class XmlReaderExtensions
 9    {
 10        internal static string ReadElementString(this XmlReader reader)
 11        {
 012            if (reader.MoveToContent() != XmlNodeType.Element)
 13            {
 014                var lineInfo = reader as IXmlLineInfo;
 015                throw new XmlException(SR.Format(SR.Xml_InvalidNodeType, reader.NodeType.ToString()), null, lineInfo?.Li
 16            }
 17
 018            return reader.ReadElementContentAsString();
 19        }
 20
 21        internal static string ReadElementString(this XmlReader reader, string localname, string ns)
 22        {
 023            if (reader.MoveToContent() != XmlNodeType.Element)
 24            {
 025                var lineInfo = reader as IXmlLineInfo;
 026                throw new XmlException(SR.Format(SR.Xml_InvalidNodeType, reader.NodeType.ToString()), null, lineInfo?.Li
 27            }
 28
 029            return reader.ReadElementContentAsString(localname, ns);
 30        }
 31    }
 32}