Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump logger to use regex parser #52

Merged
merged 3 commits into from
Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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