Class CollectionDefinitionAttribute
- Namespace
- Xunit
- Assembly
- xunit.v3.core.dll
Used to declare a test collection container class. The container class gives developers a place to attach interfaces like IClassFixture<TFixture> and ICollectionFixture<TFixture> that will be applied to all tests classes that are members of the test collection.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class CollectionDefinitionAttribute : Attribute
- Inheritance
-
CollectionDefinitionAttribute
- Inherited Members
Constructors
CollectionDefinitionAttribute()
Initializes a new instance of the CollectionDefinitionAttribute class. Use this constructor when collection references by test classes use the generic CollectionAttribute<TCollectionDefinition> attribute or refer to the fixture class using CollectionAttribute(Type).
public CollectionDefinitionAttribute()
CollectionDefinitionAttribute(string)
Initializes a new instance of the CollectionDefinitionAttribute class. Use this constructor when collection references by test classes use CollectionAttribute(string).
public CollectionDefinitionAttribute(string name)
Parameters
namestringThe test collection name.
Properties
DisableParallelization
Determines whether tests in this collection runs in parallel with any other collections.
public bool DisableParallelization { get; set; }
Property Value
Name
Gets the collection defintion name, if one was provided.
public string? Name { get; }