Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Add keyboard shortcut for Show coverage for selected test only
yanglee
#1 Posted : Wednesday, August 7, 2013 11:57:02 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
I use "Show coverage for selected test only" a lot. It greatly helped me understand my code and quickly locate the source of an issue.

But currently it's located deeply in the sub menu of the right-click menu, took me 2~3 clicks and miles of mouse moves to invoke it. If there was a keyboard shortcut (for example, Ctrl + M, C) to invoke/toggle this feature, my fingers would greatly appreciate it!

Thanks!
Yang
Remco
#2 Posted : Thursday, August 8, 2013 12:02:57 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks Yang - I also find myself thinking the same thing.

The problem is how to narrow down the coverage to a single test with the shortest number of keypresses. It could always be possible to adjust this feature so it works for multiple tests at the same time, but I think that this would make the feature confusing and probably wouldn't help much in the 99% of cases where you only want to see what a specific test is touching.

I'm thinking perhaps a single key option inside the coverage popup, i.e. 'S'. So if you were sitting on a line of code and pressed Ctrl+M, S, then positioned the cursor over the test you wanted to narrow down, and just pressed 'S', this would do the trick.

What do you think?
yanglee
#3 Posted : Thursday, August 8, 2013 1:30:02 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 6/25/2012(UTC)
Posts: 89
Location: China

Thanks: 23 times
Was thanked: 19 time(s) in 18 post(s)
I personally almost always invoke the "Show coverage for selected test only" in the body of the test method (where I start my work). So didn't think about invoking it in the production code, which could have multiple tests to select. But that would be cool :)

Quote:
The problem is how to narrow down the coverage to a single test with the shortest number of keypresses. It could always be possible to adjust this feature so it works for multiple tests at the same time, but I think that this would make the feature confusing and probably wouldn't help much in the 99% of cases where you only want to see what a specific test is touching.

Agree.

Quote:
I'm thinking perhaps a single key option inside the coverage popup, i.e. 'S'. So if you were sitting on a line of code and pressed Ctrl+M, S, then positioned the cursor over the test you wanted to narrow down, and just pressed 'S', this would do the trick.

That would be nice. But I still think it would be helpful if it there was another keyboard shortcut, that when I place cursor in the body of a test method, and press Ctrl + M, C (or something else) code coverage would be narrow down to that test. So I wouldn't have to see the coverage popup. If "Show coverage for current test" keyboard shortcut is customizable in Visual Studio's Options dialog, I may even change it to something like F1 or Alt+F1, so that I can invoke it by one hand :)
1 user thanked yanglee for this useful post.
Remco on 8/8/2013(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download