How to execute unit tests in random order in Visual Studio 2008?
I would like to execute unit tests in a random order inside visual studio. Is there a w开发者_如何学编程ay of doing it?
Is far as I can see, they are always executed in a sort of random order. You can see the actual order in the trx file. I can't say how "reliably random" it is.
Unit tests should be self contained and not impact on any other tests and all unit tests should be run to ensure the changes you made have not broken something. There is no point in running them randomly.
Each test in all the testing frameworks I know are run as a separate unit and therefore dependencies cannot occur between tests. Even items you setup in Setup methods are recreated for each unit test.
Therefore there is no point in running your tests randomly as they are self contained.
If you are talking about integration tests then that is another story.
精彩评论