views:

97

answers:

1

After using nunit for a long time, i've decided to test out Microsoft's built in testing framework.

At the beginning of my tests, I generally clean the database to get it into a state i can rely on for testing. In my test setup, i delete all the data and insert fresh data for my tests.

Since starting to use the MS tests, i've noticed my tests intermitantly fail because data resetting is conflicting. Like my tests are all being run simultaneously.

Any idea how i can get around this? Is there an option to force each class of tests to run one at a time?

Thanks for any help

+2  A: 

If you dont want to run all of your tests at one time use an Ordered Test and then right click and say run selection. If you put the test that deletes and rebuilds your tables/info first everything should work out just fine.

Ironsides
This is especially true if you are using TransactionScope for multi-part operations. Usually when you get this high up the stack, you are teetering more on implementation testing than pure unit testing, though.
joseph.ferris