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
-
- Object
- QueueClock
- FakeQueueClock
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
durationand fires every timer that becomes due, in order. -
createTimer(
Duration duration, void callback()) → Timer -
Schedules
callbackto run afterduration.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
targetand fires every timer due at or beforetarget, in order. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited