Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 way of doing it?

like image 502
Ignacio Soler Garcia Avatar asked Nov 24 '10 09:11

Ignacio Soler Garcia


People also ask

Do unit tests run in order?

Ideally, the order in which unit tests run should not matter, and it is best practice to avoid ordering unit tests. Regardless, there may be a need to do so. In that case, this article demonstrates how to order test runs. If you prefer to browse the source code, see the order .

How do I automate unit testing in Visual Studio?

To generate unit tests, your types must be public. Open your solution in Visual Studio and then open the class file that has methods you want to test. Right-click on a method and choose Run IntelliTest to generate unit tests for the code in your method. IntelliTest runs your code many times with different inputs.

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).


1 Answers

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.

like image 161
Stefan Steinegger Avatar answered Sep 28 '22 06:09

Stefan Steinegger