context library

Classes

CheckFailure
The result an expectation that failed for a subject..
Condition<T>
A set of expectations that are checked against the value when applied to a Subject.
ConditionSubject<T>
A Subject which records expectations and can replay them as a Condition.
Context<T>
The context for a Subject that allows asserting expectations and creating nested subjects.
Extracted<T>
A property extracted from a value being checked, or a rejection.
FailureDetail
The context for a failed expectation.
Rejection
A description of a value that failed an expectation.
Subject<T>
A target for checking expectations against a value in a test.

Extensions

ContextExtension on Subject<T>

Functions

describe<T>(Condition<T> condition) Iterable<String>
Creates a description of the expectations checked by condition.
describeAsync<T>(Condition<T> condition) Future<Iterable<String>>
Creates a description of the expectations checked by condition.
escape(String output) String
Returns output with all whitespace characters represented as their escape sequences.
indent(Iterable<String> lines, [int depth = 1]) Iterable<String>
literal(Object? object) Iterable<String>
Returns a pretty-printed representation of object.
postfixLast(String postfix, Iterable<String> lines) Iterable<String>
Append postfix to the last line of lines.
prefixFirst(String prefix, Iterable<String> lines) Iterable<String>
Prepends prefix to the first line of lines.
softCheck<T>(T value, Condition<T> condition) CheckFailure?
Checks whether value satisfies all expectations invoked in condition, without throwing an exception.
softCheckAsync<T>(T value, Condition<T> condition) Future<CheckFailure?>
Checks whether value satisfies all expectations invoked in condition, without throwing an exception.