Package-level declarations
Types
A scriptable NetworkDataSource (and therefore ApiClient) that never touches HTTP: every call is recorded and answered by handler. Use it to unit-test code that sits above the client — a GenericRepository, a MutationQueue, a ViewModel — without building a MockEngine or encoding JSON.
A scriptable AuthorizationProvider for tests. Tracks how many times a refresh was requested and can simulate refresh success or failure.
A controllable ReachabilityGate for tests. Starts reachable (default true, so awaitReachable returns immediately); flip it with setReachable to make a pending awaitReachable resume. awaitCount records how many times the gate was awaited.
A StructuredLogSink that records every line KenworkLogger emits, attributes included, so tests can assert on logging (e.g. that nothing sensitive is logged). Prefer withRecordedLogs, which installs one and restores the previous logger state afterwards.
A NetworkEventListener that records every emitted NetworkEvent for assertions.
A RetryPolicy that records every decision and forwards to delegate, so tests can assert how many retries happened, for which errors, and with what delays. Defaults to wrapping a DefaultRetryPolicy.
Functions
Builds a NetworkClient backed by a Ktor MockEngine driven by handler. Intended for unit tests of code that depends on kenwork — no real sockets are opened.
Routes KenworkLogger to a fresh RecordingLogSink at level for the duration of block, then restores the previous sink and level — even if block throws.