-
Notifications
You must be signed in to change notification settings - Fork 25
[BUG] Grouped TestCase test methods show full namespace and class name #533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes please, even in a very simple test suite tests are not readable from the very start: Notice how the namespace shows at two levels and then it shows again for every single test case. To see the actual test names you have to expand the panel a lot, which is not useful: Can we simplify the tree view so that it shows like this:
Would make things much easier! |
I can confirm that this issue also affects xUnit test cases defined with Theory/InlineData attributes in the Test Explorer panel in VS Code. By default, both [Fact] and [Theory] tests show the full namespace/class in Test Explorer in VS Code. This is WAY too much text, even for small projects. For example:
Fortunately, there is an xUnit configuration option to only show the method names - create xunit.runner.json with
Interestingly, this issue also affects the Test Explorer pane in full Visual Studio (or at least it did in 2020). The new Test Explorer for VS Code is great except for this issue. Hopefully someone can clean this up quickly! |
@knumat This doesn't surprise me, as we (xUnit.net) report multiple tests for the same method, so it's likely using the method name (with the namespace'd class) as the grouping point. Our |
Yep, it's clearly a UI issue, as the .NET Core Test Explorer extension does not have this issue. It never prefixes the test name with the namespace/class, so it is easy to find the test case you are looking for. |
This has been fixed and should be available in the next pre-release version that ships. |
I observe the same problem in Visual Studio 17.12.4 |
@erjok This issue has existed in Visual Studio for a while (see xunit/xunit#2122 ). You would need to contact Microsoft if you want them to update Visual Studio. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the Issue
NUnit has a
TestCaseAttribute
(reference) to support parameterizing the same test with multiple inputs.C# Dev Kit does support these tests in the Testing panel, and even helpfully groups them together.
However, the displayed name for the grouping parent is prefixed by the full namespace and class name. In a narrow view, this renders the grouping extremely unhelpful, since all the tests look like the same name. It also adversely influences the sort order:
Once you expand the grouping, the names underneath are reasonable/helpful:
It seems like xUnit theories (
TheoryAttribute
) are a similar concept. I do not know if they are similarly affected.Steps To Reproduce
[TestCase]
attribute. It must have at least two rows (otherwise it will not be grouped):Expected Behavior
I would like the displayed grouping names to not include the full namespace and class name as a prefix.
Environment Information
The text was updated successfully, but these errors were encountered: