Table of Contents

Class RenderOutputSnapshot

Namespace
SharpConsoleUI.Diagnostics.Snapshots
Assembly
SharpConsoleUI.dll

Captures the final console output string sent to Console.Write(). Used to validate actual console output and measure bytes written.

public class RenderOutputSnapshot
Inheritance
RenderOutputSnapshot
Inherited Members

Properties

BytesWritten

Gets the total number of bytes written.

public int BytesWritten { get; init; }

Property Value

int

CursorMoves

Gets the number of cursor movement commands.

public int CursorMoves { get; init; }

Property Value

int

FrameNumber

Gets the frame number this snapshot represents.

public int FrameNumber { get; init; }

Property Value

int

FullOutput

Gets the full console output string.

public string FullOutput { get; init; }

Property Value

string

Timestamp

Gets the timestamp when this snapshot was taken.

public DateTime Timestamp { get; init; }

Property Value

DateTime

Methods

CountPattern(string)

Counts occurrences of a specific ANSI pattern.

public int CountPattern(string pattern)

Parameters

pattern string

Returns

int

GetAnsiSequences()

Extracts all ANSI escape sequences from the output.

public List<string> GetAnsiSequences()

Returns

List<string>

GetCursorPositions()

Extracts all cursor positioning commands (ESC[y;xH).

public List<(int y, int x)> GetCursorPositions()

Returns

List<(int x, int y)>

GetStrippedOutput()

Gets the stripped output (ANSI codes removed).

public string GetStrippedOutput()

Returns

string