microsoft / testfx

MSTest framework and adapter
MIT License
714 stars 253 forks source link

Better DisplayNames for DataSource tests #713

Open AbhitejJohn opened 4 years ago

AbhitejJohn commented 4 years ago

Description

The test result from a test adorned by a DataSourceAttribute today has a display name as follows:

TestMethodName (DataRow0)
TestMethodName (DataRow1)
.
.
.
TestMethodName (DataRown)

The only way one can know what values were passed in is to open the data source (excel/xml etc) and get a mapping. It'd be great if there was a way to configure this or even add a default with the values being used.

Steps to reproduce

Any testmethod adorned with a DataSource should exhibit this behavior.

AB#1408169

Evangelink commented 1 year ago

When implementing this change, we need to check for the test ID generation strategy as the DisplayName strategy uses the display name as part of the ID generation. This means that updating DisplayName will be considered as breaking change, causing ID instability.

This is however fine for the other strategies.