Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 / Resharper Unit Tests don't run

I used to be able to run unit tests in VS 2012. Now, all of a sudden, whether I try to "Run" or "Debug" any unit tests, the Unit Test Sessions window puts the test into "Pending" status, but never actually executes it.

I've tried restarting my dev environment, even rebooting the computer. No change.

So where is the secret setting that says "Make unit tests freeze at 'Pending'"?

like image 920
Shaul Behr Avatar asked May 01 '13 09:05

Shaul Behr


People also ask

How do I run unit tests with ReSharper?

Ctrl+U D on the toolbar. Ctrl+U D commands, which are also available in the main menu (ReSharper | Unit Tests) and in the context menu. To run or debug all tests in solution, choose ReSharper | Unit Tests | Run All Tests from Solution in the main menu or press Ctrl+U L .

How do I run all unit tests in Visual Studio?

Run tests in Test Explorer If Test Explorer is not visible, choose Test on the Visual Studio menu, choose Windows, and then choose Test Explorer (or press Ctrl + E, T). As you run, write, and rerun your tests, the Test Explorer displays the results in a default grouping of Project, Namespace, and Class.

How do I check ReSharper code coverage?

Ctrl+U D commands. You can use this command to run coverage analysis of unit tests from the editor, from the Solution Explorer, or from unit tests sessions.

How do I get unit test coverage in Visual Studio?

Starting in Visual Studio 2022 Update 2, you can enable faster code coverage test results by selecting Tools > Options > Environment > Preview Features, then selecting Code coverage experience improvements, and then restarting Visual Studio.


2 Answers

My answer in the comments was correct

Its a resharper issue - see here. Check if your Resharper and/or VS2012 versions are the ones affected

like image 111
user1378730 Avatar answered Sep 22 '22 12:09

user1378730


I thought I'd add this in case it helps others, I did these steps...

  • Closed VS and reopened, running as Administrator.
  • Cleaned the solution, and rebuilt
  • Kicked off the tests, and they started working again

It might have been that I needed to only run as admin, but I thought I'd add all the steps I did.

like image 28
Christian Phillips Avatar answered Sep 23 '22 12:09

Christian Phillips