简体   繁体   中英

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'"?

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

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.

Goto Resharper -> Options -> General and hit the button "Clear Caches". Restart Visual Studio and unit testing should work again. No idea why this happened to me all of the sudden.

I have no idea what state your machine is in but what I would do, like debugging the code I would try and narrow down the route of the issue, So for example

  1. Check to see if your unit test has an initializer method, if it has then put a break point there and see what happens when you debug your test.

  2. Check your settings both bitness and platform ... so 64bit or 86 or AnyCPU and also debug or release settings.

  3. Finally try running a fake simple test that you can just write in seconds and see if you can narrow it down that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM