Using Test displayname with DynamicDataDisplayName in MSTest

661 views Asked by At

[TestMethod("My Test Name")] can be use to change the name of a test in MSTest. DynamicData attribute can be used to run the test on a collection of object where you can customize the datadisplayname for each run.

Unfortunately, when you try to use both for the same test like below, the test is not affected by the display name set. Any idea if it's possible to get the two attributes working at the same time.

[TestMethod("My Test")]
[DynamicData(nameof(MyTestObject), DynamicDataSourceType.Property, DynamicDataDisplayName = nameof(GetTestDisplayName))]

Thanks

0

There are 0 answers