RazorConsole.Testing 1.0.0-alpha.20261028-f1a334d

This is a prerelease version of RazorConsole.Testing.
dotnet add package RazorConsole.Testing --version 1.0.0-alpha.20261028-f1a334d
                    
NuGet\Install-Package RazorConsole.Testing -Version 1.0.0-alpha.20261028-f1a334d
                    
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="RazorConsole.Testing" Version="1.0.0-alpha.20261028-f1a334d" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RazorConsole.Testing" Version="1.0.0-alpha.20261028-f1a334d" />
                    
Directory.Packages.props
<PackageReference Include="RazorConsole.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 RazorConsole.Testing --version 1.0.0-alpha.20261028-f1a334d
                    
#r "nuget: RazorConsole.Testing, 1.0.0-alpha.20261028-f1a334d"
                    
#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 RazorConsole.Testing@1.0.0-alpha.20261028-f1a334d
                    
#: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=RazorConsole.Testing&version=1.0.0-alpha.20261028-f1a334d&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=RazorConsole.Testing&version=1.0.0-alpha.20261028-f1a334d&prerelease
                    
Install as a Cake Tool

RazorConsole.Testing

Test hosts for RazorConsole applications. Send keyboard, mouse and raw terminal input, wait for the screen to reach a state, and assert on the rendered cells. Works with any test framework.

  • HeadlessTerminal mounts one component in the test process, at a fixed terminal size. Use it for component and integration tests.
  • PtyTerminal runs a built console application in a real pseudoterminal: ConPTY on Windows (10 version 1809 or later), a POSIX PTY on Linux and macOS. Use it for end-to-end tests.

Install

dotnet add package RazorConsole.Testing

The examples are xUnit v3 test bodies; ct is TestContext.Current.CancellationToken.

HeadlessTerminal

Clicking the README counter button with Enter:

await using var terminal = await HeadlessTerminal.StartAsync<Counter>(width: 60, height: 10, cancellationToken: ct);

await terminal.SendKeyAsync(ConsoleKey.Enter, '\r', cancellationToken: ct);

await terminal.WaitUntilAsync(
    frame => Regex.IsMatch(frame.ScreenText, @"Current count +1\b"),
    cancellationToken: ct);

PtyTerminal

await using var terminal = await PtyTerminal.StartDotnetAsync(
    Path.Combine(AppContext.BaseDirectory, "MyApp.dll"), width: 100, height: 30, cancellationToken: ct);

await terminal.WaitForTextAsync("MyApp is ready", cancellationToken: ct);
await terminal.SendKeyAsync(ConsoleKey.C, '\x03', ConsoleModifiers.Control, ct);

Assert.Equal(0, await terminal.WaitForExitAsync(cancellationToken: ct));

Documentation

See the Testing guide for input, waits, frames, layout, diagnostics, parallel runs and platform notes.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.  net11.0 is compatible. 
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
1.0.0-alpha.20261028-f1a334d 25 10/28/2026
1.0.0-alpha.20261028-56ba6f9 14 10/28/2026
1.0.0-alpha.20261027-7b604cb 38 10/27/2026
1.0.0-alpha.20261026-c36835b 53 10/26/2026
1.0.0-alpha.20261026-355d7a0 48 10/26/2026
1.0.0-alpha.20261024-cf797fc 63 10/24/2026
1.0.0-alpha.20261019-135f601 58 10/19/2026