Skip to main content
Xunit.StaFact package icon

Xunit.StaFact

Run your xunit-based tests on an STA thread with the WPF Dispatcher, a WinForms SynchronizationContext, or even a cross-platform generic UI thread emulation with a SynchronizationContext that keeps code running on a "main thread" for that test. Simply use [WpfFact], [WinFormsFact], [StaFact] or the cross-platform [UIFact] on your test method to run your test under conditions that most closely match the main thread in your application. Theory variants of these attributes allow for parameterized testing. Check out the xunit.combinatorial nuget package for pairwise or combinatorial testing with theories.

Total Downloads
4.2M
4,247,348
Published
Apr 12, 2025
Latest stable version

Install

.NET CLI
dotnet add package Xunit.StaFact --version 2.1.7
Package Manager Console
Install-Package Xunit.StaFact -Version 2.1.7
PackageReference
<PackageReference Include="Xunit.StaFact" Version="2.1.7" />

Frameworks

.NETFramework4.7.2 net8.0 net8.0-macos14.0 net8.0-windows7.0 .NETStandard2.0

Dependencies

[2.0.0, )
[2.0.0, )
[2.0.0, )
[2.0.0, )

Adoption guide

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

Compatibility metadata lists 5 target frameworks; confirm the exact target used by your application.

How to read this guidance

Sources: published NuGet v3 registry metadata and explicit NuBrowse editorial guides. Refresh: package metadata is refreshed from NuGet when the page loads. Limit: this is not a security, legal or compatibility guarantee; validate the selected version in your project.

Useful next steps

Move from package metadata to a concrete selection or review workflow.