Test cases with ArgDisplayNames containing closing braces ) are recognized as a different test and names are truncated after first closing brace
#1359
Replies: 1 comment
-
|
@MineCake147E Thanks for a good repro! I have added your code as a repro here: https://github.com/nunit/nunit3-vs-adapter.issues/tree/master/Issue1357 In this repro I have added dump'ing using the .runsettings file. If you look at the execution dump, you will see exactly what the adapter sends out. And, that is the full named line, as in your testcases. (I have enclosed the dump file zip'ed). Also, if you check the output from
So the problem is in the Test Explorer. And, it the way the Test Explorer groups the tests. The default is Project/NameSpace/Class, and that will then look like this, matching what you have observed.
If you change the grouping to only use Project (which is actually no grouping at all), it all looks fine:
So, the test explorer doesn't understand these "complex" names, and use the The reason for the two top nodes are a bit weird, but it is also the Test Explorer being confused by this. Just for "fun": Visual Studio Code with the Test Explorer extension from Jun Han behaves the exact same way.
Now, if we look at the events from the dump file you will see that NUnit give you a complete tree based on the real structure of the tests, note Assembly on top, then every level down to a class is a TestSuite, the class is a TestFixture, the test method is next level, and in the end you have the test itself. This structure is test based.
Unfortunately, Test Explorer don't want to display things this way. However, if you use [TestCentric[(https://test-centric.org/) (from @CharliePoole ) you can see that real structure.
PS: If you try this, note that it is bundled with max Net 6.0 agent, and I couldn't make the net 10 work there, but Charlie will fix this soon. |
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
-
Description
When discovering the test cases with non-
stringarguments that have argument display names containing closing braces()(U+0029 RIGHT PARENTHESIS)), NUnit3TestAdapter (if not VS2026) treats them as if it were the end of the argument list, and truncates the test display name after that.On the other hand, it can handle the
stringarguments with)fine, unless the next character is.(U+002E FULL STOP).Expected Behaviour
All tests for the same method show up in a single group.
Actual Behaviour
Other Information
VSTestAdapterArgNameCloseBraceBugRepro.csprojBeta Was this translation helpful? Give feedback.
All reactions