Class CollectionAttribute<TCollectionDefinition>
- Namespace
- Xunit
- Assembly
- xunit.v3.core.dll
Used to declare a specific test collection for a test class. Equivalent to using CollectionAttribute with the type-based constructor.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
public sealed class CollectionAttribute<TCollectionDefinition> : Attribute, ICollectionAttribute
Type Parameters
TCollectionDefinitionThe type for the collection definition.
- Inheritance
-
CollectionAttribute<TCollectionDefinition>
- Implements
- Inherited Members
Remarks
.NET Framework does not support generic attributes. Please use the non-generic CollectionAttribute when targeting .NET Framework.
Properties
Name
Gets the name of the collection.
public string Name { get; }
Property Value
Type
Gets the collection definition type. Returns null if the collection is purely
based on name.
public Type? Type { get; }