Separate `GetDisplayName` out of `ITestDataSource`
I think ITestDataSources shouldn't be concerned with how they are displayed.
I think it may be better to either remove GetDisplayName completely, or introduce it as a separate interface
To be investigated: what is the current behavior if an implementation of GetDisplayName returned null. Are we going to fallback to a "nice" display name that correctly takes into account the parameters of the test?
In the split interface for display name it would be nice to have some helpers that I can use to implement it. Right now you can only implement it from scratch, and have to get all the details of parameter serialization right etc. Or you can prepend some data, but you cannot easily replace the name, but keep the parameter part.
https://github.com/microsoft/testfx/issues/1180#issuecomment-1277155353
We need to discuss more if we need to take this break for v4 or postpone to v5 if it's going to be too hard for users.
Alternative ideas:
- Treat
nullvalue returned fromGetDisplayNameas "use the default implementation" - Expose the internal helper that's used for getting display name.
I would be for the helper approach, because we don't have to limit ourselves to just one helper, and it is easier to give the different parts to the user to use them.
But this solution to this seems tangential to removing the method from ITestDataSource, and can be implemented without breaking change as a new feature in the current version as well.
IIRC, the helper takes TestIdGenerationStrategy or something like that which exists today for backcompat reasons which we may want to break in v4. So might be better to expose the helper in v4 rather than introducing in 3.x and changing signature in v4.
Not going to do this breaking change, at least in v4. Instead, we will automatically use the default display name when GetDisplayName returns null.