Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,8 @@ private TestElement CreateTestElement(Guid testId, string name, string fullyQual
{
var codeBase = source;
var className = GetTestClassName(name, fullyQualifiedName, source);
var testMethod = new TestMethod(name, className);
var testMethodName = fullyQualifiedName.StartsWith(className) ? fullyQualifiedName.Remove(0, $"{className}.".Length) : fullyQualifiedName;
var testMethod = new TestMethod(testMethodName, className);

testElement = new UnitTestElement(testId, name, adapter, testMethod);
(testElement as UnitTestElement).CodeBase = codeBase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ private void ValidateTestMethodProperties(string testName, string fullyQualified
TestPlatformObjectModel.TestResult result = new TestPlatformObjectModel.TestResult(testCase);

var unitTestElement = this.converter.ToTestElement(testCase.Id, Guid.Empty, Guid.Empty, testName, TrxLoggerConstants.UnitTestType, testCase) as UnitTestElement;
var expectedTestName = fullyQualifiedName.StartsWith(expectedClassName) ? fullyQualifiedName.Remove(0, $"{expectedClassName}.".Length) : fullyQualifiedName;

Assert.AreEqual(expectedClassName, unitTestElement.TestMethod.ClassName);
Assert.AreEqual(testName, unitTestElement.TestMethod.Name);
Assert.AreEqual(expectedTestName, unitTestElement.TestMethod.Name);
}

private static TestCase CreateTestCase(string fullyQualifiedName)
Expand Down