Skip to content

Commit

Permalink
Trx changes for fqdn mapping in test method name (#2259)
Browse files Browse the repository at this point in the history
* Trx changes for fqdn mapping in test method name

* Review comments
  • Loading branch information
vagisha-nidhi authored Dec 2, 2019
1 parent 4ce924b commit daf9b36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit daf9b36

Please sign in to comment.