Test collections are the test grouping mechanism in xUnit.net v2. They serve two purposes:
- They delineate the "parallelism" boundary; that is, tests in the same collection will not be run in parallel against each other;
- They offer collection-wide fixtures through the use of
ICollectionFixture<TFixtureType>
.
The simplest way to use test collections is simply by name. Put two classes into the same named collection, and they can derive benefit #1 above:
[Collection("MyCollection")]
public class TestClass1