Class StaFactAttribute
- Namespace
- Xunit
- Assembly
- Xunit.StaFact.dll
Identifies an xunit test that starts on an STA thread. Tests will be Skipped on non-Windows operating systems.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer(typeof(StaFactDiscoverer))]
public class StaFactAttribute : FactAttribute, _Attribute, IFactAttribute
- Inheritance
-
FactAttributeStaFactAttribute
- Implements
-
IFactAttribute
- Inherited Members
-
FactAttribute.DisplayNameFactAttribute.ExplicitFactAttribute.SkipFactAttribute.SkipExceptionsFactAttribute.SkipTypeFactAttribute.SkipUnlessFactAttribute.SkipWhenFactAttribute.SourceFilePathFactAttribute.SourceLineNumberFactAttribute.Timeout
Remarks
The test does not apply a SynchronizationContext, so an async test will resume on a standard MTA thread from the thread pool. To get an STA thread even after awaiting expressions, use UIFactAttribute.
Constructors
StaFactAttribute(string?, int)
Initializes a new instance of the StaFactAttribute class.
public StaFactAttribute(string? sourceFilePath = null, int sourceLineNumber = -1)