Table of Contents

Class CollectionBehaviorAttribute

Namespace
Xunit
Assembly
xunit.v3.core.dll

Default implementation of ICollectionBehaviorAttribute.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class CollectionBehaviorAttribute : Attribute, ICollectionBehaviorAttribute
Inheritance
CollectionBehaviorAttribute
Implements
Inherited Members

Constructors

CollectionBehaviorAttribute()

Initializes a new instance of the CollectionBehaviorAttribute class. Uses the default collection behavior (CollectionPerClass).

public CollectionBehaviorAttribute()

CollectionBehaviorAttribute(Type)

Initializes a new instance of the CollectionBehaviorAttribute class with the given custom collection behavior.

public CollectionBehaviorAttribute(Type collectionFactoryType)

Parameters

collectionFactoryType Type

The factory type

CollectionBehaviorAttribute(CollectionBehavior)

Initializes a new instance of the CollectionBehaviorAttribute class with the given built-in collection behavior.

public CollectionBehaviorAttribute(CollectionBehavior collectionBehavior)

Parameters

collectionBehavior CollectionBehavior

The collection behavior for the assembly.

Properties

CollectionFactoryType

Gets the collection factory type specified by this collection behavior attribute.

public Type? CollectionFactoryType { get; }

Property Value

Type

DisableTestParallelization

Determines whether tests in this assembly are run in parallel.

public bool DisableTestParallelization { get; set; }

Property Value

bool

MaxParallelThreads

Determines how many tests can run in parallel with each other. If set to 0, the system will use ProcessorCount. If set to a negative number, then there will be no limit to the number of threads.

public int MaxParallelThreads { get; set; }

Property Value

int

ParallelAlgorithm

Determines the parallel algorithm used when running tests in parallel.

public ParallelAlgorithm ParallelAlgorithm { get; set; }

Property Value

ParallelAlgorithm