TestCaseMonitor class final

A monitor for the behavior of a callback when it is run as the body of a test case.

Allows running a callback as the body of a local test case and querying for the current state, and errors, and subscribing to future errors.

Use run to run a test body and query for the success or failure.

Use start to start a test and query for whether it has finished running.

Properties

errors Iterable<AsyncError>
The errors surfaced by the test.
no setter
hashCode int
The hash code for this object.
no setterinherited
onDone Future<void>
A future that completes after this test has finished running, or has surfaced an error.
no setter
onError Stream<AsyncError>
A stream of errors surfaced by the test.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state State
The running and success or failure status for the test case.
no setter

Methods

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

Static Methods

run(FutureOr<void> body()) Future<TestCaseMonitor>
Run body as a test case and return a TestCaseMonitor with the result.
start(FutureOr<void> body()) TestCaseMonitor
Start body as a test case and return a TestCaseMonitor with the status and result.