RecordingTarget
ConsoleMonster.Output
An in-memory target for tests: output collects in RecordingTarget.Text, optional scripted keys answer prompts, and the screens that prompts, menus, forms and grids draw collect in RecordingTarget.Screens. Pair with GoldenFile through RecordingTarget.MatchGolden. Create one with TestTerminal.Target.
Inheritance
- object
- RecordingTarget
Usage
Explore 1 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 1
- Method TestTerminal.Target
Constructors
public RecordingTarget(TerminalProfile profile, string? keys = null) #Creates a recording target.
Parameters
- profile ConsoleMonster.Capabilities.TerminalProfile
- The profile (use TestTerminal.Profile for a fixed one).
- keys string? = null
- Scripted keys for prompts (see TestTerminal.Keys), or null for no input.
Methods
public void MatchGolden(string path) #Compares RecordingTarget.Text with a golden file (see GoldenFile.Match).
Parameters
- path string
- The golden file path.
public CellBuffer Transcript() #Replays the captured output into cells, including colours and cursor movement, at this target's fixed size. Prompt and application frames captured directly in RecordingTarget.Screens remain separate.
Inherited Methods
Properties
public string Name { get; } #A short description for diagnostics, for example console or recording 80x24.
public TerminalProfile Profile { get; } #The capability profile for a write happening now (the console's refreshes its size on every call).
public ITerminalWriter? Writer { get; } #The writer that receives the output, or null for the process console. The target owns it: callers write and flush but never dispose it.
public IInputSource? Input { get; } #The input for prompts, menus and forms, or null. On the console null means the keyboard; on any other target it means nobody can answer, so prompts use their defaults or explain what is missing.
public ScreenCapture Screens { get; } #The screens drawn by prompts, menus, forms, grids and selected live-session checkpoints.
public bool SkipDelays { get; set; } #Skips LiveSession.Delay waits and captures a compact dashboard checkpoint in RecordingTarget.Screens instead. Default false; configure before starting the session.
public bool CaptureViewport { get; set; } #Captures Delay checkpoints at the profile's full viewport size, including constrained layouts and captured console logs. Append-only outputs commit heartbeat summaries at logical checkpoints instead of capturing bitmap frames. Default false keeps compact block checkpoints. Viewport animation frames follow checkpoint order. Configure before starting the session.
public int[]? Checkpoints { get; set; } #Zero-based live-session Delay calls to capture when RecordingTarget.SkipDelays is enabled; null captures all, an empty array captures none. Configure before starting the session. Checkpoint order assumes one producer.
public int CheckpointCount { get; } #Total valid Delay calls on sessions using this target, including checkpoints that were not selected.
public string Output { get; } #Everything written so far, exactly as written (including colour codes when the profile has colour).
public string Text { get; } #The output as plain text: escape sequences removed, line endings normalised to \n.