1

I've written some unit tests with Microsoft.VisualStudio.TestTools.UnitTesting. If I open a class that's under test - I can't see any reference(s) to the Unit Test written for it's methods.

Right-mouse click on a method shows the ReSharper option "run/debug unit tests" but it is always showing the (ReSharper) dialog "No Tests Found in File". Clicking the VS2013 options "run/debug unit test" only shows "build succeeded" - nothing more. But, even if this would work, I still can't see at a first glance that there are any unit tests.

But I would rather see some kind of Icon/image at the beginning of the method - indicating that there's a unit test available for this method.

Is this possible? I've VS2013 with ReSharper 8+ available.

Many thanks in advance.

JonHendrix
  • 933
  • 15
  • 28

1 Answers1

1

You can know if a unit test is calling the method by clicking the Find Usages contextual menu item when pointing the method name.

If it is a nested call, you have no choice but to enable Code Coverage to see if your method is called by tests.

Keysharpener
  • 486
  • 3
  • 14
  • Oh nice - I totally forgot about the code covarage feature. Sadly it's not supported by my Professional edition. Only: Ultimate and Premium. – JonHendrix Nov 21 '14 at 08:50
  • 1
    There is a handful of tools that allow you to do Code Coverage, but they all come with a non negligeable price tag (except opencover, but i don't know what it's worth). See this for more info : http://stackoverflow.com/questions/276829/code-coverage-for-c-net – Keysharpener Nov 21 '14 at 08:58
  • As a side note : selecting run tests from a normal class doesn't do anything, it only works when you are in a test class. – Keysharpener Nov 21 '14 at 09:01