Bug Report T418389
Visible to All Users

Nunit 3 TestCaseData Name is not used for a test name in TestRunner

created 9 years ago (modified 9 years ago)

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.

  1. 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.

  2. 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? )

Comments (1)
DevExpress Support Team 9 years ago

    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.

    Answers approved by DevExpress Support

    created 8 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.