8

I was wondering if there is a plugin that allows me to jump directly to the test for the current class (Or create it if it doesn't exist).

I guess this should be based on the convention that the test project is named like the project being tested + "test" and the test class is named like the class being tester + "test".

A feature like that would really help in projects with many files and foldes, where scrolling the solution explorer to find the associated test project can be quite annoying.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Kaj Bonfils
  • 416
  • 4
  • 10
  • Did you try using built-in test feature? – Bartek Banachewicz Sep 24 '12 at 11:08
  • I am using the ReSharper testrunner for too long, but I am sure to remember that in the Visual Studio test window a simple double click into the list of tests should bring you back. – Jens H Sep 24 '12 at 12:09
  • Although not technically your answer, I make do with Resharper 6. Ctrl+T, TAM for TestAccountManager to jump to the type. Follow that up with Alt+\, to jump to specific test member. – Gishu Sep 24 '12 at 12:20
  • Let me be a little more specific on what im looking for. I already use Resharper as my testrunner and I'm aware of the features in that product. Currently im working in a solution with 43 projects, including test projects, and a lot of files. The overview is lost, even using the features of the test manager. Im looking for a tool that would allow me to navigate between the current implementation file and the associated test file and vice versa. Also I would like to be able to create a test file in the right location if one doesn't exist.... – Kaj Bonfils Sep 25 '12 at 18:21

4 Answers4

2

how about NCrunch? This tool will show you, per method, which and how many tests are covering it:

NCrunch shows how many tests are covering

double-click navigates to test

RoelF
  • 7,483
  • 5
  • 44
  • 67
  • Thanks... Not exactly what I thought I was looking for, but it does the job! – Kaj Bonfils Mar 26 '13 at 11:16
  • NCrunch might do the job and the capabilities look awesome from checking out the website, but it requires your project be setup in a specific way, not cool. – Jeremy May 26 '16 at 08:15
1

I did manage to find a few extensions on visualstudiogallery.com, but ended up writing my own plugin for this. Its not perfect, but i does what I needed.

If anyone else would like, its available for free at testlocator.eqa.dk

Kaj Bonfils
  • 416
  • 4
  • 10
  • Following extra features would be nice for TestLocator: A. Decorate the files that already have a corresponding test (similar to MoreUnit for Eclipse: http://moreunit.sourceforge.net/) B. Support several configurations for different file extensions (e.g. .cs **and** .js) C. Support tests in the same project (e.g. by allowing a / in the project extension: /MyTestSubFolder?) – Stefan Apr 11 '16 at 16:59
0

In Visual Studio you can Shift+F12 on any class or method definition to find all references. Although the resulting list Studio is not very convenient, but a starting point. Using a tool like DevExpress CodeRush or ReSharper lets you sort and filter by namespace, project, file, etc.

Dennis Traub
  • 50,557
  • 7
  • 93
  • 108
0

If you happen to use ReSharper, it has a TestLinker plugin.

It does the job pretty well.

Basic shortcut: Ctrl+Alt+F7.

Goto Related Files is extended with navigation points to production/test classes.

New shortcuts ReSharper_GotoAllLinkedTypes and ReSharper_GotoLinkedTypesWithDerivedName (assignable via keyboard options) that jumps between linked types. In case of multiple linked types, a dedicated popup menu is shown, which can also be displayed in Find Results window.

Demo