Reputation: 1207
This seems to be an error with the JetBrains Resharper 9.1 Ultimate Test Runner referencing an older version of NUnit. I am using NUnit 3.0 in my assembly.
[Window Title]
Unit Test Runner
[Main Instruction]
Unit Test Runner failed to run tests
[Expanded Information]
at NUnit.Core.Builders.TestAssemblyBuilder.GetCandidateFixtureTypes(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
at JetBrains.ReSharper.UnitTestRunner.nUnit.BuiltInNUnitRunner.RunTests(IRemoteTaskServer server, Dictionary`2 tests, Dictionary`2 fixtures, List`1 explicitly, Boolean useAddins, List`1 assemblies)
EDIT: Problem goes away with upgrade to version 10 of Resharper.
Upvotes: 40
Views: 11371
Reputation: 664
Going into the
ReSharper v10
Options screen, underTools | Unit Testing | NUnit
, there is an option setting forWhen to use NUnit 3 test runner
. Setting this toAlways
resolved the problem for me. The error message shown above no longer appears after making this change.
Unable to run NUnit's unit tests with ReSharper's test runner
Upvotes: 0
Reputation: 411
As mentioned in the accepted answer, ReSharper 9 does not support NUnit 3. The solution as stated does work (i.e. update to ReSharper 10), however, for those who do not have this option (e.g. licensing), you can downgrade your version of NUnit by following the below steps:
Uninstall-Package NUnit
followed by
Install-Package NUnit -Version 2.6.4
Your tests should now run using ReSharper 9.
Upvotes: 27
Reputation: 4822
What worked for me (VS 2015):
1) installed NUnit Test Adapter 3.2
2) opened Test Explorer: VS -> menu Test -> Windows -> Test Explorer
3) ran test: In Test Explorer window (if no test, rebuild solution) selected test to run, right clicked and "Run Selected Tests"
voila I can see the test in Test Explorer window and select one and debug it.
Upvotes: 4
Reputation: 82545
As mentioned in the other answer, the real fix is to upgrade to ReSharper 10. But if you can't do that, you can disable ReSharper 9's unit-test functionality and fall back to Visual Studio's built-in Test Explorer.
To do this:
Upvotes: 4
Reputation: 2611
As Yousefi mentioned, this is fixed by updating to version 10 of ReSharper. I had the same issue and that resolved it.
Upvotes: 15