Skip to main content

Arlecchino.Testing

Classes

TypeSummary
ArlecchinoTestHostA whole application wired up for a test: real services, a terminal in memory, and no loop in the background. Frames are drawn when asked for, so a test presses keys and then reads the screen.
FakeTerminalA terminal that keeps everything in memory: keys queued in, output collected as text, and the size a test sets. The input queues are concurrent, so keys can be delivered late as a real terminal delivers them.
FrameTextPulls apart what was written to a terminal. A frame is text with escape sequences woven through it, which is unreadable in an assertion message, so these separate the content from the styling and let a test assert on either.
ScreenGridA terminal screen as the terminal itself would hold it: a grid of cells that output is applied to rather than collected in, obeying the escapes FrameText strips out.
SessionTapeA session written down: the events that go in, the waits between them, and where a frame is worth looking at. A tape is written by hand rather than recorded. csharp var frames = new SessionTape() .Type(":") .Shot() .Type("copy") .Wait(200) .Shot() .Play(host); Assert.Contains("Copy files", frames[^1], StringComparison.Ordinal);
TestClockA clock a test moves by hand. Scheduled work runs when the clock passes its due time, so a second is moved rather than waited for.