Vion.Dale.DevHost.Xunit 0.9.7

Prefix Reserved
dotnet add package Vion.Dale.DevHost.Xunit --version 0.9.7
                    
NuGet\Install-Package Vion.Dale.DevHost.Xunit -Version 0.9.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vion.Dale.DevHost.Xunit" Version="0.9.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vion.Dale.DevHost.Xunit" Version="0.9.7" />
                    
Directory.Packages.props
<PackageReference Include="Vion.Dale.DevHost.Xunit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Vion.Dale.DevHost.Xunit --version 0.9.7
                    
#r "nuget: Vion.Dale.DevHost.Xunit, 0.9.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Vion.Dale.DevHost.Xunit@0.9.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Vion.Dale.DevHost.Xunit&version=0.9.7
                    
Install as a Cake Addin
#tool nuget:?package=Vion.Dale.DevHost.Xunit&version=0.9.7
                    
Install as a Cake Tool

Vion.Dale.DevHost.Xunit

xUnit.net v3 integration for Vion Dale DevHost scenario files (RFC 0006). It removes the boilerplate a consumer otherwise hand-rolls to run committed *.scenario.json files as tests:

  • [ScenarioFiles] — a theory data source that discovers every committed scenario and yields one (string id, string topology) row per file, display-named by title with spec traits. Each scenario becomes its own entry in Test Explorer / --list-tests.
  • DevHostScenarioFixture — a fixture base that loads a topology file, optionally on a deterministic stepping clock, then builds and starts a host. The only thing you supply is your block catalog (ConfigureDi).
  • RunScenarioAsync / ApplyScenarioAsync / AssertSucceeded — one-line run + assert over ScenarioRunner.

It is a separate package (not part of Vion.Dale.DevHost) so a non-test DevHost consumer is never forced to take an xUnit dependency.

Usage

// One fixture names your block catalog — the only consumer-specific part of host construction.
public sealed class MyHostFixture : DevHostScenarioFixture
{
    protected override DevHostBuilder ConfigureDi(DevHostBuilder builder) =>
        builder.WithDi<MyLibrary.DependencyInjection>();
}

public class CommittedScenariosShould : IClassFixture<MyHostFixture>
{
    private readonly MyHostFixture _fixture;
    public CommittedScenariosShould(MyHostFixture fixture) => _fixture = fixture;

    [Theory]
    [ScenarioFiles]                       // one row per committed *.scenario.json
    public async Task RunsGreen(string id, string topology)
    {
        await using var host = await _fixture.LoadAsync(topology, stepped: true);
        (await host.RunScenarioAsync(id)).AssertSucceeded();
    }
}

For assertions the JSON scenario vocabulary can't express, use ApplyScenarioAsync as the arrange/stimulate phase and then assert in C#:

[Fact]
public async Task PeakShaving_LeavesConsumerServed()
{
    await using var host = await _fixture.LoadAsync("em-closed-loop", stepped: true);
    await host.ApplyScenarioAsync("peak-shaving");
    // ... arbitrary C# assertions on host.Control.GetProperty(...) ...
}

Determinism

For reproducible, flake-free CI, build the host stepped: true (a FakeTimeProvider virtual clock) and write scenarios using advance / settle / waitUntil rather than the wall-clock wait.

Topologies

A scenario only runs against the topology it declares. [ScenarioFiles] carries each scenario's topology as the second row value so the fixture can build the matching host. Keep a ProjectReference to the library that declares your block types so the topology loader can resolve them.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.7 37 7/10/2026
0.9.6 92 7/7/2026
0.9.5 102 7/1/2026
0.9.4 115 6/29/2026
0.9.3 98 6/28/2026
0.9.2 114 6/25/2026
0.9.1 98 6/24/2026
0.9.0 100 6/24/2026
0.9.0-preview.7 71 6/24/2026
0.9.0-preview.6 55 6/22/2026
0.9.0-preview.5 62 6/19/2026
0.9.0-preview.4 65 6/18/2026