Skip to content

Conversation

@vagisha-nidhi
Copy link
Contributor

@vagisha-nidhi vagisha-nidhi commented Nov 29, 2019

Fixing data driven xunit method name.

image
image

The execution id and the test Id is linking attributes between the 2 nodes. The result node will remain as is and it today contains the display name for the result which translates to test run title in the pipeline.
In the Unit Test definition node the method name of xunit test is "XUnitTestProject.UnitTest1.Test1(a: 1)" which technically speaking is not correct. It has to be "XUnitTestProject.UnitTest1.Test1" and we are not losing any data this way as the result display name still remains the same.

This fix is taken as part of running the data driven xunit tests in pipeline

Debug.Assert(!string.IsNullOrEmpty(name), "name is null");
Debug.Assert(!string.IsNullOrEmpty(className), "className is null");
this.name = name;
this.name = name.StartsWith(className) ? name.Remove(0, $"{className}.".Length) : name;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do this in the Converter itself ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. done

@vagisha-nidhi vagisha-nidhi merged commit daf9b36 into microsoft:master Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants