GridTestDriver class Core
Drives a grid with synthetic input through the same code its real handlers use and reports what the grid believes, in one wording on every host. Coordinates are logical units; keys are Win32 virtual-key codes, so one scenario drives every host.
public sealed class GridTestDriver
- Namespace
- ArionUI.Grid.Testing
- Package
- ArionUI.Grid ·
dotnet add package ArionUI.Grid --prerelease
Properties
CellsDrawn
public static long CellsDrawn { get; }Cells (slots) drawn by every grid and tile of the process so far: what a bench divides by its frames to show that two ways of drawing did the same work.
FrameCount
public long FrameCount { get; }Frames the host has presented so far.
HostState
public string HostState { get; }Host-specific state (tooltips, validation tips) as one line.
HoverBandMotion
public (double, int) HoverBandMotion { get; }Screen pixels the hover band travelled so far, and how often it started moving after standing: a band that stands while the wheel scrolls adds nothing.
Remarks
The bands of the grids in view tiles on a board count too: their bands are the ones that move there, not the board's.
Repainted
public RepaintTally Repainted { get; }The repainted area of the frames presented so far, in device pixels; the flash shows the same areas but need not be on.
Scale
public double Scale { get; }Logical unit to device pixel.
ScrollTravel
public static double ScrollTravel { get; }Logical pixels the drawn pictures of every grid and tile scrolled by so far: cells per scrolled pixel compare two scrolls of different speed.
StateLine
public string StateLine { get; }The host-neutral state line a parity run compares; empty before a view is mounted.
Methods
AcceleratorLetter
public static char AcceleratorLetter(int virtualKey);Letters that reach the grid as accelerators next to the key.
Capture
public bool Capture(string path, bool forceFullFrame = false);Writes the presented frame to a PNG (blit state included unless forceFullFrame).
CapturePaneLayer
public bool CapturePaneLayer(string path);Writes the floating pane layer to a PNG.
Click
public void Click(double x, double y, ArionModifiers mods = default);A left click (press and release) with optional modifiers.
ClickAt
public bool ClickAt(string spec, bool right = false, int clicks = 1);Moves to a named target and clicks it; false when the name resolves to nothing.
DoubleClick
public void DoubleClick(double x, double y);Two clicks, the second with click count 2, as the platforms report it.
Down
public void Down(double x, double y, bool right = false, int clickCount = 1, ArionModifiers mods = default);Presses a button at a logical position through the host's press path.
Drag
public void Drag(double x, double y);A move with the button held (after GridTestDriver.Down).
FreezeCaret
public void FreezeCaret();Stops the caret blink for pixel comparisons.
Key
public bool Key(int virtualKey, ArionModifiers mods = default);A key by Win32 virtual-key code through the production key path.
Returns
Whether the grid handled it.
KeyFromVirtualKey
public static ArionKey KeyFromVirtualKey(int virtualKey);The one virtual-key table every host runner shares. Z and Y stay unmapped like in the real handlers: Ctrl+Z/Y travel as accelerator letters.
Move
public void Move(double x, double y);Moves the pointer to a logical position (with the button held after GridTestDriver.Down).
PointOf
public (double, double)? PointOf(string spec);Logical coordinates of a named target ("header:3", "cell:5,2", "filtericon:2"), or null when it names nothing.
Probe
public string Probe(double x, double y);What the grid believes is at a logical position: zone, chrome bands and hover state, in one wording on every host.
RenderNow
public void RenderNow();Forces one frame now and returns once it is drawn.
RightClick
public void RightClick(double x, double y);A right click (press and release).
SetInjecting
public void SetInjecting(bool on);Marks the start and end of scripted input, so a real mouse cannot interfere.
Settle
public void Settle();Finishes any in-flight scroll at its destination and refreshes the hover, so a comparison reads where the hosts scrolled, not how far each clock got.
StateLineOf
public string StateLineOf(ArionView view);The state line of view: this grid's when it shows the view, that of the view tile showing it otherwise; empty when it is shown nowhere.
Type
public void Type(string text);Text through the production entry path, one character at a time.
Up
public void Up(double x, double y);Releases the button at a logical position.
Wheel
public void Wheel(int rawDelta, bool horizontal = false);Wheel by a raw Win32 amount (120 per notch). An open pane scrolls its own list first; the grid only gets what the pane did not take.
