• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zorbathut / dec / 11670896818

04 Nov 2024 07:02PM UTC coverage: 90.556%. Remained the same
11670896818

push

github

zorbathut
Removed redundant namespaces

4564 of 5040 relevant lines covered (90.56%)

191694.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/ReaderXmlSimple.cs
1
using System.Linq;
2
using System.Xml.Linq;
3

4
namespace Dec
5
{
6
    internal static class ReaderFileXmlSimple
7
    {
8
        public static ReaderNodeParseable Create(string input, string rootTag, string identifier, Recorder.IUserSettings userSettings)
9
        {
505✔
10
            XDocument doc = UtilXml.ParseSafely(new System.IO.StringReader(input));
505✔
11
            if (doc == null)
505✔
12
            {
×
13
                return null;
×
14
            }
15

16
            if (doc.Elements().Count() > 1)
505✔
17
            {
×
18
                // This isn't testable, unfortunately; XDocument doesn't even support multiple root elements.
19
                Dbg.Err($"{identifier}: Found {doc.Elements().Count()} root elements instead of the expected 1");
×
20
            }
×
21

22
            var record = doc.Elements().First();
505✔
23
            if (record.Name.LocalName != rootTag)
505✔
24
            {
×
25
                Dbg.Wrn($"{new InputContext(identifier, record)}: Found root element with name `{record.Name.LocalName}` when it should be `{rootTag}`");
×
26
            }
×
27

28
            return new ReaderNodeXml(record, identifier, userSettings);
505✔
29
        }
505✔
30
    }
31
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc