ConditionSubject<T> class

A Subject which records expectations and can replay them as a Condition.

Implemented types
Available extensions

Properties

context Context<T>

Available on Subject<T>, provided by the ContextExtension extension

The expectations and nesting context for this subject.
no setter
entries Subject<Iterable<MapEntry<K, V>>>

Available on Subject<Map<K, V>>, provided by the MapChecks extension

no setter
first Subject<T>

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

no setter
hashCode int
The hash code for this object.
no setterinherited
keys Subject<Iterable<K>>

Available on Subject<Map<K, V>>, provided by the MapChecks extension

no setter
last Subject<T>

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

no setter
length Subject<int>

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

no setter
length Subject<int>

Available on Subject<Map<K, V>>, provided by the MapChecks extension

no setter
length Subject<int>

Available on Subject<String>, provided by the StringChecks extension

no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single Subject<T>

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

no setter
values Subject<Iterable<V>>

Available on Subject<Map<K, V>>, provided by the MapChecks extension

no setter
withQueue Subject<StreamQueue<T>>

Available on Subject<Stream<T>>, provided by the WithQueueExtension extension

Wrap the stream in a StreamQueue to allow using checks from StreamChecks.
no setter

Methods

any(Condition<T> elementCondition) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains at least on element such that elementCondition is satisfied.
anyOf(Iterable<Condition<T>> conditions) → void

Available on Subject<T>, provided by the CoreChecks extension

Expects that the value satisfies the expectations invoked in at least one condition from conditions.
anyOf(Iterable<Condition<StreamQueue<T>>> conditions) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the stream statisfies at least one condition from conditions.
apply(Subject<T> subject) → void
Check the expectations of this condition against subject.
override
applyAsync(Subject<T> subject) Future<void>
Check the expectations of this condition against subject.
override
completes([Condition<T>? completionCondition]) Future<void>

Available on Subject<Future<T>>, provided by the FutureChecks extension

Expects that the Future completes to a value without throwing.
contains(Pattern pattern) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the value contains pattern according to String.contains;
contains(T element) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains element according to Iterable.contains.
containsInOrder(Iterable<String> expected) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the String contains each of the sub strings in expected in the given order, with any content between them.
containsInOrder(Iterable<Object?> elements) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains a value matching each expected value from elelements in the given order, with any extra elements between them.
containsKey(K key) → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

Expects that the map contains key according to Map.containsKey.
containsKeyThat(Condition<K> keyCondition) → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

Expects that the map contains some key such that keyCondition is satisfied.
containsValue(V value) → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

Expects that the map contains value according to Map.containsValue.
containsValueThat(Condition<V> valueCondition) → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

Expects that the map contains some value such that valueCondition is satisfied.
deepEquals(Iterable<Object?> expected) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains elements that are deeply equal to the elements of expected.
deepEquals(Map<Object?, Object?> expected) → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

Expects that the map contains entries that are deeply equal to the entries of expected.
doesNotComplete() → void

Available on Subject<Future<T>>, provided by the FutureChecks extension

Expects that the Future never completes as a value or an error.
emits([Condition<T>? emittedCondition]) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expect that the Stream emits a value without first emitting an error.
emitsError<E extends Object>([Condition<E>? errorCondition]) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the stream emits an error of type E.
emitsThrough(Condition<T> condition) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the Stream emits any number of events before emitting an event that satisfies condition.
endsWith(String other) → void

Available on Subject<String>, provided by the StringChecks extension

equals(T other) → void

Available on Subject<T>, provided by the CoreChecks extension

Expects that the value is equal to other according to operator ==.
equals(String expected) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the String contains exactly the same code units as expected.
equalsIgnoringCase(String expected) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the String contains the same characters as expected if both were lower case.
equalsIgnoringWhitespace(String expected) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the String contains the same content as expected, ignoring differences in whitsepace.
every(Condition<T> elementCondition) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects there are no elements in the iterable which fail to satisfy elementCondition.
has<R>(R extract(T), String name) Subject<R>

Available on Subject<T>, provided by the CoreChecks extension

Extracts a property of the value for further expectations.
identicalTo(T other) → void

Available on Subject<T>, provided by the CoreChecks extension

Expects that the value is identical to other.
inOrder(Iterable<Condition<StreamQueue<T>>> conditions) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the stream satisfies each condition in conditions serially.
isA<R>() Subject<R>

Available on Subject<T>, provided by the CoreChecks extension

Expects that the value is assignable to type T.
isCloseTo(num other, num delta) → void

Available on Subject<num>, provided by the NumChecks extension

Expects that the difference between this number and other is less than or equal to delta.
isDone() Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the stream closes without emitting any events or errors.
isEmpty() → void

Available on Subject<String>, provided by the StringChecks extension

isEmpty() → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

isEmpty() → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

isFalse() → void

Available on Subject<bool>, provided by the BoolChecks extension

isFinite() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isFinite is true.
isGreaterOrEqual(T other) → void

Available on Subject<Comparable<T>>, provided by the ComparableChecks extension

Expects that this value is greater than or equal to other.
isGreaterThan(T other) → void

Available on Subject<Comparable<T>>, provided by the ComparableChecks extension

Expects that this value is greater than other.
isInfinite() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isInfinite is true.
isLessOrEqual(T other) → void

Available on Subject<Comparable<T>>, provided by the ComparableChecks extension

Expects that this value is less than or equal to other.
isLessThan(T other) → void

Available on Subject<Comparable<T>>, provided by the ComparableChecks extension

Expects that this value is less than other.
isNaN() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isNaN is true.
isNegative() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isNegative is true.
isNotEmpty() → void

Available on Subject<String>, provided by the StringChecks extension

isNotEmpty() → void

Available on Subject<Map<K, V>>, provided by the MapChecks extension

isNotEmpty() → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

isNotFinite() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isFinite is false.
isNotInfinite() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isInfinite is false.
isNotNaN() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isNaN is false.
isNotNegative() → void

Available on Subject<num>, provided by the NumChecks extension

Expects that num.isNegative is false.
isNotNull() Subject<T>

Available on Subject<T?>, provided by the NullableChecks extension

isNull() → void

Available on Subject<T?>, provided by the NullableChecks extension

isTrue() → void

Available on Subject<bool>, provided by the BoolChecks extension

matchesPattern(Pattern expected) → void

Available on Subject<String>, provided by the StringChecks extension

Expects that the string matches the pattern expected.
mayEmit(Condition<T> condition) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Optionally consumes an event that matches condition from the stream.
mayEmitMultiple(Condition<T> condition) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Optionally consumes events that match condition from the stream.
neverEmits(Condition<T> condition) Future<void>

Available on Subject<StreamQueue<T>>, provided by the StreamChecks extension

Expects that the stream closes without emitting any event that satisfies condition.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
not(Condition<T> condition) → void

Available on Subject<T>, provided by the CoreChecks extension

Check that the expectations invoked in condition are not satisfied by this value.
pairwiseComparesTo<S>(List<S> expected, Condition<T> elementCondition(S), String description) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains elements that correspond by the elementCondition exactly to each element in expected.
returnsNormally() Subject<T>

Available on Subject<T Function()>, provided by the FunctionChecks extension

Expects that the function returns without throwing.
skip(String message) Subject<T>

Available on Subject<T>, provided by the SkipExtension extension

Mark the currently running test as skipped and return a Subject that will ignore all expectations.
startsWith(Pattern other) → void

Available on Subject<String>, provided by the StringChecks extension

throws<E extends Object>([Condition<E>? errorCondition]) Future<void>

Available on Subject<Future<T>>, provided by the FutureChecks extension

Expects that the Future completes as an error.
throws<E>() Subject<E>

Available on Subject<T Function()>, provided by the FunctionChecks extension

Expects that a function throws synchronously when it is called.
toString() String
A string representation of this object.
override
unorderedEquals(Iterable<T> expected) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains elements which equal those of expected in any order.
unorderedMatches(Iterable<Condition<T>> expected) → void

Available on Subject<Iterable<T>>, provided by the IterableChecks extension

Expects that the iterable contains elements which match all conditions of expected in any order.
which(Condition<T> condition) → void

Available on Subject<T>, provided by the CoreChecks extension

Applies the expectations invoked in condition to this subject.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](K key) Subject<V>

Available on Subject<Map<K, V>>, provided by the MapChecks extension