Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In xUnit.net, is it possible to run tests in order?

Tags:

I know you generally should not depend on order for your unit tests, but in xunit is it possible to make your tests run in a certain order?

like image 572
Lance Fisher Avatar asked Aug 08 '09 22:08

Lance Fisher


People also ask

Do xUnit tests run in order?

Ordering classes and casesTests are executed in ascending order. If no Order attribute is specified default 0 is assigned. Multiple Order attributes can have same value.

Does xUnit run tests in parallel?

Running unit tests in parallel is a new feature in xUnit.net version 2. There are two essential motivations that drove us to not only enable parallelization, but also for it to be a feature that's enabled by default: As unit testing has become more prevalent, so too have the number of unit tests.


1 Answers

There is a sample in our Samples project named PrioritizedFixtureSample which allows you to control the ordering of tests.

See the samples in our latest release: https://xunit.net/#releases

like image 130
Brad Wilson Avatar answered Sep 21 '22 13:09

Brad Wilson