Navigate between tests and tested code

Last modified: 11 February 2024

ReSharper helps you navigate between unit tests and tested code. When your caret is at the name of a class or anywhere within its declaration, you can press to navigate to related tests and vice versa, by pressing this shortcut on a test, you will jump to the tested class.

This navigation is also available in the Navigate To menu: select Test Subject if you navigate from a unit test, and Related Tests when you navigate from a tested class.

For navigating to and from unit tests, ReSharper establishes links between test classes and the corresponding tested classes. There are several approaches to linking tests and tested classes: all of them are used by default, and you can configure them on the Tools | Unit Testing | Test Linker page of ReSharper options Alt+R, O:

This feature is supported in the following languages and technologies:

The instructions and examples given here address the use of the feature in C#. For more information about other languages, refer to corresponding topics in the Languages and frameworks section.