InMemorySystem class final

A deterministic System with mutable in-memory process state.

Implemented types

Constructors

InMemorySystem({Map<String, String> environment = const <String, String>{}, String directory = '/', DateTime? now})
Creates a system fake seeded with environment, directory, and now.

Properties

directory String
Working directory the fake answers from.
getter/setter pair
environmentVariables Map<String, String>
Mutable environment the fake answers from.
final
hashCode int
The hash code for this object.
no setterinherited
now DateTime
Instant the fake's clock answers with.
getter/setter pair
requestedDelays List<Duration>
Every duration passed to delay, in call order.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

currentDirectory() → Result<String>
Returns the current working directory as an absolute path.
override
delay(Duration duration) Future<Result<void>>
Delays without exposing the host timer implementation.
override
enqueueClockResult(Result<DateTime> result) → void
Scripts the next nowUtc answer.
enqueueDelayResult(Result<void> result) → void
Scripts the next delay answer.
enqueueDirectoryResult(Result<String> result) → void
Scripts the next currentDirectory answer.
enqueueEnvironmentResult(Result<String?> result) → void
Scripts the next environment answer.
environment(String name) → Result<String?>
Looks up one process environment variable.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nowUtc() → Result<DateTime>
Returns the current instant in UTC.
override
toString() String
A string representation of this object.
inherited

Operators

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