From 3be607be9d2c433dc67e3f0b993fa49844be3e4c Mon Sep 17 00:00:00 2001 From: Jesse Phillips Date: Fri, 26 Feb 2021 13:03:57 -0800 Subject: [PATCH] :bug: Don't require Run User to be specified Execution coming out of the new dotnet test may not have a run user. --- TRX2HTML Solution/trx2html/Parser/TrxParser.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TRX2HTML Solution/trx2html/Parser/TrxParser.cs b/TRX2HTML Solution/trx2html/Parser/TrxParser.cs index dac6165..7f1cb9c 100644 --- a/TRX2HTML Solution/trx2html/Parser/TrxParser.cs +++ b/TRX2HTML Solution/trx2html/Parser/TrxParser.cs @@ -73,7 +73,8 @@ public TestRunResult Parse(string filePath) XNamespace ns = "http://microsoft.com/schemas/VisualStudio/TeamTest/2010"; string name = doc.Document.Root.Attribute("name").Value; - string runUser = doc.Document.Root.Attribute("runUser").Value; + var userAttr = doc.Document.Root.Attributes().FirstOrDefault(x => x.Name.LocalName == "runUser"); + string runUser = userAttr == null ? "NA" : userAttr.Value; var unitTests = doc.Descendants(ns + "UnitTest").ToList(); var unitTestResults = doc.Descendants(ns + "UnitTestResult").ToList(); var result = from u in unitTests