Sendproof.Journeys.Testing 0.1.0-alpha.2

This is a prerelease version of Sendproof.Journeys.Testing.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Sendproof.Journeys.Testing --version 0.1.0-alpha.2
                    
NuGet\Install-Package Sendproof.Journeys.Testing -Version 0.1.0-alpha.2
                    
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="Sendproof.Journeys.Testing" Version="0.1.0-alpha.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sendproof.Journeys.Testing" Version="0.1.0-alpha.2" />
                    
Directory.Packages.props
<PackageReference Include="Sendproof.Journeys.Testing" />
                    
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 Sendproof.Journeys.Testing --version 0.1.0-alpha.2
                    
#r "nuget: Sendproof.Journeys.Testing, 0.1.0-alpha.2"
                    
#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 Sendproof.Journeys.Testing@0.1.0-alpha.2
                    
#: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=Sendproof.Journeys.Testing&version=0.1.0-alpha.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sendproof.Journeys.Testing&version=0.1.0-alpha.2&prerelease
                    
Install as a Cake Tool

Sendproof.Journeys.Testing

Runs every Sendproof journey as an xUnit test case, in memory through WebApplicationFactory, with Preview by default: all of a journey's steps run in one held Preview session, so a later step sees what an earlier one wrote, and nothing is committed. Each step's success criteria are checked and its writes compared with the expectations document, as the workbench and sendproof journeys run do.

Use it

public sealed class JourneyTests : JourneyTestSuite<StoreApplication>
{
}
  • TEntryPoint is any class in the app's assembly; the suite lists the journeys defined in that assembly, one test case each, and starts the app's own entry point for each one.
  • Reference Microsoft.AspNetCore.Mvc.Testing from the test project too: its build targets record the app's content root.
  • A failing journey fails its test with a report: each step's status, the criteria that failed, and each write that differs, is missing or is extra.

Sending for real

Send-only journeys (they write to Redis, say) are sent, and so is every journey when the host can't hold Preview sessions. The suite refuses to send unless you say so, so it never writes to a development database by accident:

public sealed class JourneyTests : JourneyTestSuite<StoreApplication>, IDisposable
{
    private readonly DirectoryInfo _directory = Directory.CreateTempSubdirectory("store-journeys-");

    protected override bool AllowSend => true;

    protected override void ConfigureWebHost(IWebHostBuilder builder) =>
        builder.UseSetting("DemoDatabasePath", Path.Combine(_directory.FullName, "store.db"));

    public void Dispose() => _directory.Delete(recursive: true);
}

Override Mode to send every journey, and Inputs(journeyId) to give inputs other than the defaults. RunAsync(journeyId, inputs) runs one journey and returns its JourneyRunResult for your own assertions.

The runner on its own

JourneyRunner runs a journey against any HttpClient that reaches a Sendproof host: it reads capabilities, the Arazzo and expectations documents and the OpenAPI document, signs in as the journey's persona through the personas provider, and runs each step.

var result = await new JourneyRunner(client).RunAsync("orderToShipment", inputs: new JsonObject { ["quantity"] = 2 });
Console.WriteLine(result.Report());

Libraries

Bielu.Arazzo.NET (MIT) reads the Arazzo document and evaluates runtime expressions; Microsoft.OpenApi reads the OpenAPI document; JsonPath.Net (MIT) evaluates JSONPath criteria. The simple-condition parser and the write comparison are the package's own: no library covers Sendproof's expectations.

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.1.0-alpha.3 0 11/24/2026
0.1.0-alpha.2 42 11/24/2026