dcli.testing 0.2.0-rc.4

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

dcli.testing

Headless test harness for the dcli inline terminal-rendering library.

dcli.testing lets you drive the real dcli render engine — input parser, fixed-region composer, scrollback model, overlays, virtual clock — against in-memory fakes instead of a real TTY. No PTY, no raw mode, no ANSI pollution in your test output.

Quick start

using Dcli;
using Dcli.Testing;
using Xunit;

public class MyFeatureTests
{
    [Fact]
    public async Task StatusLineAppearsInSnapshot()
    {
        await using HeadlessTerminal harness = await HeadlessTerminal.StartAsync();

        harness.Terminal.Status.SetRows([new Line([new Segment("Ready")])]);
        await harness.SettleAsync();

        FrameSnapshot snap = harness.Snapshot;
        string pretty = FrameSnapshotPrinter.PrettyPrint(snap);

        Assert.Contains("Ready", pretty);
    }
}

Key types

Type Description
HeadlessTerminal Entry point. StartAsync() builds a live harness; SettleAsync() drains pending work and waits for a coalesced frame.
HeadlessTerminalOptions Configures initial size, minimum frame interval, and virtual clock.
VirtualClock Deterministic clock; Advance(span) advances time without wall-clock delay, triggering throttled paints.
FrameSnapshot Immutable capture of LiveWindowRows, FixedRegionRows, caret, size, newly-committed rows, and overlay state.
FrameSnapshotPrinter PrettyPrint(snapshot) — ASCII-bordered, style-stripped frame string, stable for golden-frame assertions.

Scripting methods

Method What it does
SendKey(KeyEvent) Injects a named or character key directly into the render loop.
Type(string) Types each rune as a Char key event. For named keys (Enter, Tab, arrows) use SendKey.
Paste(string) Posts a bracketed-paste event.
Feed(ReadOnlySpan<byte>) Feeds raw bytes through the real VT parser on the InputReader thread.
Resize(cols, rows) Triggers a resize event via the same path as POSIX SIGWINCH.

What's NOT here

This package contains only the headless harness. The production dcli rendering engine, public API (ITerminal, Scrollback, Input, Status, Autocomplete), and event model live in the dcli package. Add both packages to test projects:

<PackageReference Include="dcli" Version="0.1.0-rc.1" />
<PackageReference Include="dcli.testing" Version="0.1.0-rc.1" />
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.
  • net10.0

    • dcli (>= 0.2.0-rc.4)

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.2.0-rc.4 0 5/31/2026
0.2.0-rc.2 56 5/28/2026

Headless test harness for dcli: HeadlessTerminal, scripted input drivers, deterministic SettleAsync, virtual clock, structured frame Snapshot.