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

Trx changes for fqdn mapping in test method name #2259

Merged
merged 2 commits into from
Dec 2, 2019
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