Table of Contents

Codebelt.Extensions.Xunit Namespace

Use Test as the base class for xUnit tests that need a shared output helper, lifecycle support, or wildcard assertions. Use InMemoryTestStore<T> when a test needs a small in-process collection that can be queried without external storage. TestOutputHelperExtensions writes several values as separate output lines.

When methods in one test class must run in sequence, apply [TestMethodOrderer(typeof(PriorityTestMethodOrderer))] to the class and [Priority(n)] to its methods. Lower numbers run first, equal priorities are ordered by method name, and methods without a priority run last. xUnit still runs separate test classes in parallel unless the test assembly disables that behavior.

Availability: .NET 11, .NET 10 and .NET Standard 2.0

Complements: xUnit: Capturing Output 🔗

Extension Members

Type Ext Methods
ITestOutputHelper ⬇️ WriteLines, WriteLines<T>
String ⬇️ ReplaceLineEndings (TFM netstandard2.0)

Classes

InMemoryTestStore<T>

Provides a default base implementation of the ITestStore<T> interface.

PriorityAttribute

Assigns a numeric execution priority to a test method when its class uses PriorityTestMethodOrderer.

PriorityTestMethodOrderer

Orders test methods by PriorityAttribute, followed by ordinal method name.

Test

Represents the base class from which all implementations of unit testing should derive.

TestOutputHelperAccessor

Provides a default implementation of the Xunit.ITestOutputHelper interface.

TestOutputHelperExtensions

Extension methods for the Xunit.ITestOutputHelper.

WildcardOptions

Configuration options for Match(string, string, Action<WildcardOptions>).

Interfaces

ITest

Represents the members needed for vanilla testing.

ITestOutputHelperAccessor

Provides an interface for accessing the Xunit.ITestOutputHelper instance.

ITestStore<T>

Represents the members needed for adding and querying a store tailored for unit testing.