Visual Studio plug in to jump to test class
Asked Answered
C

4

10

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.

Colic answered 24/9, 2012 at 11:5 Comment(4)
Did you try using built-in test feature?Brittle
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.Parshall
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.Marcellemarcellina
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....Colic
O
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

Oneirocritic answered 2/11, 2012 at 12:9 Comment(2)
Thanks... Not exactly what I thought I was looking for, but it does the job!Colic
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.Emory
C
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

Colic answered 2/11, 2012 at 11:49 Comment(1)
Following extra features would be nice for TestLocator: A. Decorate the files that already have a corresponding test (similar to MoreUnit for Eclipse: 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: <ProjectExtension>/MyTestSubFolder</ProjectExtension>?)Alphonsa
U
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.

Unbowed answered 24/9, 2012 at 12:12 Comment(0)
S
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

Succinate answered 18/3, 2022 at 11:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.