views:

17

answers:

1

Everything's in the title. I use MoreUnit in Eclipse which allow me to switch back and forth between a class and its unit test and I was wondering if anything like this was available in Visual Studio 2008.

Thanks

Alexandre

A: 

There is no such functionality in Visual Studio 2008.

If you think about it, it makes sense as well: there are no constraints on how you arrange your unit tests, and while the most common pattern is to have all tests of a specific System Under Test (SUT) in the same test class, other (reasonable) patterns also exist. Given that, how would VS know where to go when the context is a specific class?

The unit tests may be scattered accross multiple files.

That said, you can use Shift+F12 to show all references of a class. If your unit tests are loaded in the same solution, they will appear in the list of candidates, so should be easier to find.

Going the other way is even simpler because you can simply select the SUT in the test and hit F12 to go to the definition.

Mark Seemann
I agree with you regarding the organization of the unit tests. There is the exact same issue in Eclipse. There is just a pattern that is to have one unit test class per class and to mirror the packages as well.Thanks for the tip.
alex_C