I'm using Visual Studio 2008 and NUnit 2.6.3 together with Resharper 8.2
Resharper recognizes my Unit tests (so I can run them with Resharper) but yet they are all marked as unused (classes as well as the individual test methods). I know how to suppress the warning with a comment at each test class but I am looking for a solution without such comments because they also affect test code that is really unused (and thus I should be warned).
From my understanding this should work out of the box for NUnit tests but I can't manage to make it work. Do I have to change some settings? I googled quite a while but didn't find anything.
You need to install ReSharper ExternalAnnotations to solve the problem. VS2008 does not support ReSharper Extension Manager, so please install it manually:
- Download nuget package;
- Open it using any archiver software like WinZip;
- Extract all folders from
..\ReSharper\vAny\annotations\toC:\Program Files (x86)\JetBrains\ReSharper\v8.2\Bin\ExternalAnnotations; - Then restart Visual Studio;
来源:https://stackoverflow.com/questions/23735896/resharper-marks-my-nunit-tests-as-unused