views:

176

answers:

3

Greetings, I would like to make NUnit execute my unit tests in a random order every time in order to ensure they are isolated and FIRST. Does anyone know of a easy way to do this well without branching NUnit?

A: 

My advice is to use IronPython for testing. Write your tests as IronPython scripts, and then randomly call the test function. The other advantage of IronPython is that you can quickly debug things that aren't working; create a few objects, stick 'em together, and make sure they behave as you intend them to. It's really powerful once you get the hang of it.

Mark P Neyer
I already have over 2000 nUnit tests, so re-writing them is not appealing.
ryber
A: 

Maybe try running your tests with ReSharper? I believe it runs tests in parallel, and in a non-deterministic order, but I'm not 100% sure on that.

mgroves
I use resharper. It runs them in the same order every time.
ryber
+4  A: 

There looks to be an nUnit add-in for this: http://www.nablasoft.com/alkampfer/index.php/2008/12/06/randomizer-nunit-addin/

Matt Poush