FakeSyncClock class
Mutable clock for deterministic time in tests.
Pass call as the engine clock, then move time forward explicitly:
final clock = FakeSyncClock(DateTime.utc(2026, 1, 1));
final engine = SyncEngine(
store: InMemorySyncStore(),
transport: FakeSyncTransport(),
clock: clock.call,
);
clock.advance(const Duration(minutes: 1));
Constructors
- FakeSyncClock(DateTime now)
-
Creates a clock frozen at
now.
Properties
Methods
-
advance(
Duration duration) → void -
Moves now forward by
duration. -
call(
) → DateTime -
Returns now; matches the engine's
Clocksignature. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited