FakeQueueClock class final

A controllable QueueClock for tests.

Time only moves when advance or setNow is called, and timers scheduled through createTimer fire synchronously in due-time order as the clock reaches their deadline.

Inheritance

Constructors

FakeQueueClock([DateTime? initialTime])

Properties

hashCode → int
The hash code for this object.
no setterinherited
pendingTimerCount → int
The number of active timers currently waiting to fire.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

advance(Duration duration) → void
Moves the clock forward by duration and fires every timer that becomes due, in order.
createTimer(Duration duration, void callback()) → Timer
Schedules callback to run after duration.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
now() → DateTime
The current time.
override
setNow(DateTime target) → void
Sets the current time to target and fires every timer due at or before target, in order.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited