When using TestCaseSource and TestCaseData attributes on a test the name I have set explicitly on the TestCaseData objects are not being used by the TestRunner when displaying the tests. There are two issues here.
-
Before running the tests the test runner only shows a single test using the test method name. If I right click this in the test runner and try to run the tests no tests get run.
-
After running the tests from the method quick access icon the test runner shows all the tests but they all have the same test name taken from the test method name + parameter list.
This obscures the uniqueness of each test and find the failing case if one of them fails. I have attached a screen shot showing the following:
- On the right is source code for the Test and TestCaseSource.
- On the top left is how Visual Studio Test Runner with the nunit3 plugin displays these tests. Notice how the TestCaseData.Name is used to clearly distinguishing each test and it's purpose.
- On the bottom left if the CodeRush test runner show the same tests after they have been run. Notice the test names are the same for all the test with the exception of the parameters. 1. This makes the test names really long and 2. If all my parameters were complex object type I would not be able to distinguish the tests from one another. ( in fact how would the test runner? )
Hi Allen,
Thank you for letting us know about this problem.
We absolutely agree that CodeRush test runner should take into account the TestCaseData.Name property value when displaying information about a test. You will be notified when we fix this problem.
As for the second issue you reported, I have created a separate ticket on your behalf: The Test runner doesn't run tests with the TestCaseSource attribute when the run is initiated from the Test Runner window's context menu. Let us continue discussion of this problem in that thread.