views:

14

answers:

1

Hi every one, I often have to restart my IDE when trying to run a test set from within Visual Studio 2010 since it keeps being hung/not-responding very often.

Do you have the same problem? If you do, do you have a work-around for that? Please share.

A: 

I'll share my setup with you. It won't solve your problem but might give you some ideas to improve your unit tests.

First, my unit tests do not connect to the database or reference cookies / session. In those scenarios, I use Dependency Injection (with Castle Windsor) to pass fake repositories to the unit tests. If your unit tests are hitting anything external (Web services, SQL, IIS) that might be a good place to look.

I use NUnit / Moq for the unit tests themselves. I had been using the NUnit client to run the unit tests but then I stumbled on a tool called Gallio that allows me to run (and debug) my unit tests from within Visual Studio.

I'm not sure if Gallio is compatible with your unit tests or not, but it might be beneficial to debug the unit tests to see exactly where they are hanging up.

EDIT: Thought I'd add that I'm using Visual Studio 2010 Premium and I have about 110 tests so far that complete in a few seconds. The tests hit ASP.NET MVC controller actions.

Mayo