Skip to content

Commit

Permalink
Merge pull request #52 from Siphonophora/UseRegexParser
Browse files Browse the repository at this point in the history
Bump logger to use regex parser
  • Loading branch information
Siphonophora authored Apr 3, 2022
2 parents 42cd7e2 + 2af9af6 commit 82f7701
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<MSTestVersion>2.0.0</MSTestVersion>
<NETTestSdkVersion>15.7.2</NETTestSdkVersion>
<MoqVersion>4.9.0</MoqVersion>
<TestLoggerVersion>3.0.54</TestLoggerVersion>
<TestLoggerVersion>3.0.78</TestLoggerVersion>

<!-- Test Assets use the minimum supported versions -->
<NETTestSdkMinimumVersion>15.5.0</NETTestSdkMinimumVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ public void MethodFormat_Default_ShouldBeOnlyTheMethod()

foreach (var testcase in testcases)
{
var parsedName = TestCaseNameParser.Parse(testcase.Attribute("name").Value);
var parsedName = new TestCaseNameParser().Parse(testcase.Attribute("name").Value);

// A method name only will not be parsable into two pieces
Assert.AreEqual(parsedName.TypeName, TestCaseNameParser.TestCaseParserUnknownType);
Assert.AreEqual(parsedName.Type, TestCaseNameParser.TestCaseParserUnknownType);
}

Assert.IsTrue(new JunitXmlValidator().IsValid(resultsXml));
Expand All @@ -143,11 +143,12 @@ public void MethodFormat_Class_ShouldIncludeClass()

foreach (var testcase in testcases)
{
var parsedName = TestCaseNameParser.Parse(testcase.Attribute("name").Value);
// Note the new parser can't handle the names with just class.method
var parsedName = new LegacyTestCaseNameParser().Parse(testcase.Attribute("name").Value);

// If the name is parsable into two pieces, then we have a two piece name and
// consider that to be a passing result.
Assert.AreNotEqual(parsedName.TypeName, TestCaseNameParser.TestCaseParserUnknownType);
Assert.AreNotEqual(parsedName.Type, TestCaseNameParser.TestCaseParserUnknownType);
}

Assert.IsTrue(new JunitXmlValidator().IsValid(resultsXml));
Expand All @@ -167,13 +168,13 @@ public void MethodFormat_Full_ShouldIncludeNamespaceAndClass()

foreach (var testcase in testcases)
{
var parsedName = TestCaseNameParser.Parse(testcase.Attribute("name").Value);
var parsedName = new TestCaseNameParser().Parse(testcase.Attribute("name").Value);

// We expect the full name would be the class name plus the parsed method
var expectedFullName = parsedName.NamespaceName + "." + parsedName.TypeName + "." + parsedName.MethodName;
var expectedFullName = parsedName.Namespace + "." + parsedName.Type + "." + parsedName.Method;

// If the name is parsable into two pieces, then we have at least a two piece name
Assert.AreNotEqual(parsedName.TypeName, TestCaseNameParser.TestCaseParserUnknownType);
Assert.AreNotEqual(parsedName.Type, TestCaseNameParser.TestCaseParserUnknownType);
Assert.AreEqual(expectedFullName, testcase.Attribute("name").Value);
}

Expand Down

0 comments on commit 82f7701

Please sign in to comment.