Table of Contents

Class UITheoryAttribute

Namespace
Xunit
Assembly
Xunit.StaFact.dll

Identifies an xunit theory that starts on a UI thread-like SynchronizationContext such that awaited expressions resume on the test's "main thread". On Windows, the test runs on an STA thread.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
[XunitTestCaseDiscoverer(typeof(UITheoryDiscoverer))]
public class UITheoryAttribute : TheoryAttribute, _Attribute, ITheoryAttribute, IFactAttribute
Inheritance
FactAttribute
TheoryAttribute
UITheoryAttribute
Implements
ITheoryAttribute
IFactAttribute
Inherited Members
TheoryAttribute.DisableDiscoveryEnumeration
TheoryAttribute.SkipTestWithoutData
FactAttribute.DisplayName
FactAttribute.Explicit
FactAttribute.Skip
FactAttribute.SkipExceptions
FactAttribute.SkipType
FactAttribute.SkipUnless
FactAttribute.SkipWhen
FactAttribute.SourceFilePath
FactAttribute.SourceLineNumber
FactAttribute.Timeout

Constructors

UITheoryAttribute(string?, int)

Initializes a new instance of the UITheoryAttribute class.

public UITheoryAttribute(string? sourceFilePath = null, int sourceLineNumber = -1)

Parameters

sourceFilePath string
sourceLineNumber int