Table of Contents

Class TinyBddXunitBase

Namespace
TinyBDD.Xunit.v3
Assembly
TinyBDD.Xunit.v3.dll

Base class for xUnit.v3 that initializes TinyBDD ambient context in the constructor and writes a Gherkin report when disposed at the end of the test.

[Feature("Unnamed Feature", null)]
public abstract class TinyBddXunitBase : TestBase, IAsyncLifetime, IAsyncDisposable
Inheritance
TinyBddXunitBase
Implements
IAsyncLifetime
Inherited Members

Remarks

The constructor sets Current and wires an XunitTraitBridge. Xunit.IAsyncLifetime.InitializeAsync() executes any configured background steps. DisposeAsync() emits a Gherkin report and clears the ambient context.

To configure background steps, override ConfigureBackground().

Constructors

TinyBddXunitBase(ITestOutputHelper)

Initializes the base with xUnit's Xunit.ITestOutputHelper and sets up TinyBDD context.

protected TinyBddXunitBase(ITestOutputHelper output)

Parameters

output ITestOutputHelper

Properties

Reporter

The reporter used to emit scenario output (e.g., Gherkin-style summaries) at cleanup. Framework-specific base classes should provide an appropriate implementation.

protected override IBddReporter Reporter { get; }

Property Value

IBddReporter

Methods

DisposeAsync()

Writes a Gherkin report and clears the ambient context.

public virtual ValueTask DisposeAsync()

Returns

ValueTask

InitializeAsync()

Executes background steps if configured.

public virtual ValueTask InitializeAsync()

Returns

ValueTask