Grouping by class name in VS 2012 doesn't work

Bug #1155617 reported by Terje Sandstrom
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
NUnit Test Adapter
Fix Released
Critical
Charlie Poole

Bug Description

In VS 2012 Update 2 one can group tests by class name. This doesnt work properly, as every method is placed in each own group, and the class names are repeated.
This is caused by the conversion from NUnit Test names to VS Testcase names, where the Testcase.FullyQualifiedName is set equal to NUnit.TestName.UniqueName. This UniqueName is prefixed with a number, which caused them to be unique..... In this case this causes the behaviour above.
The correction would be to change this to use NUnit.TestName.Fullname instead.

Related branches

Revision history for this message
Terje Sandstrom (b-tfrje-j) wrote :

Added screenshot showing issue

Changed in nunit-vs-adapter:
assignee: nobody → Terje Sandstrom (b-tfrje-j)
Revision history for this message
Tom Jacques (tejacques) wrote :

I stumbled across this today after installing VS Update 2 to get Class-level test groupings to work. I decided to fix it according to the method outlined by Terje. It appears to work well for me. Attached is a patch of the diff.

Here's an image of how it looks:
http://i.imgur.com/VDms9N0.png

Changed in nunit-vs-adapter:
status: New → Triaged
importance: Undecided → Critical
Changed in nunit-vs-adapter:
milestone: none → 0.95
Changed in nunit-vs-adapter:
assignee: Terje Sandstrom (b-tfrje-j) → Charlie Poole (charlie.poole)
Changed in nunit-vs-adapter:
status: Triaged → Fix Committed
Revision history for this message
Charlie Poole (charlie.poole) wrote :

Bug is now fixed, but the fix causes some duplicate tests to be skipped. That's because UniqueName was making them unique. We'll deal with that problem separately and in a way that doesn't harm the ability to display tests by class.

@Tom: I used part of your patch. Some of the changes you made could lead to duplicate keys in the dictionary of NUnit tests so I didn't use them. However, it was useful to see that the code misled you a bit, since it didn't distinguish clearly between maps of NUnit tests and maps of VS TestCases. I changed some names to make that clearer.

Charlie

Revision history for this message
Tom Jacques (tejacques) wrote :

@Charlie: Happy to be useful. I actually did encounter some errors with the changes I made, and I see now from your comment why they were cropping up. One thought I had was perhaps altering UniqueName (or creating a new version of it) that put the uniqueness at the end, since that shouldn't affect group by class name, while still keeping the uniqueness. I don't know enough about the code base to know everything that could break, however. In any case, thanks for fixing this. It's a really great feature of the new VS and it's fantastic to be able to use it with NUnit.

Changed in nunit-vs-adapter:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.