IterableAssertions<T> class

Contains a number of methods to assert that a Iterable is in the expected state.

Inheritance

Constructors

IterableAssertions(Iterable<T>? subject, {bool isReversed = false, String? subjectLabel})
Initializes a new instance of the BoolAssertions class.

Properties

and IterableAssertions<T>
Bind assertions
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isReversed bool
Checking reverse
finalinherited
not IterableAssertions<T>
Invert assertion
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subject Iterable<T>?
the object which value is being asserted.
finalinherited
subjectLabel String
Friendly label for the subject object
no setterinherited

Methods

all(void predicate(T item)) IterableAssertions<T>
any(bool predicate(T item)) IterableAssertions<T>
Asserts that the collection contains at least one item that matches the predicate.
as(String subjectLabel) IterableAssertions<T>
Set friendly title for the subject
inherited
be(Object expected) IterableAssertions<T>
Asserts that the value is equal to the specified expected value. expected The expected value
override
beAssignableTo<U>() → U?
Asserts that the object is assignable to a variable of type U
inherited
beEmpty() IterableAssertions<T>
Asserts that the collection does not contain any items.
beNull() IterableAssertions<T>
Asserts that the object is not null
inherited
beOfType<U>() → U?
Asserts that the object is not of the specified type U
inherited
beOneOf(Iterable<Iterable<T>> validItems) IterableAssertions<T>
Asserts that a value is one of the specified validItems
inherited
contain(T expected) IterableAssertions<T>
Expects the current collection to contain the specified element.
containAll(Iterable<T> expected) IterableAssertions<T>
Expects the current collection to contain the specified elements.
copy(Iterable<T>? subject, {bool isReversed = false, String? subjectLabel}) IterableAssertions<T>
Copy the matcher
override
every(bool predicate(T item)) IterableAssertions<T>
Asserts that the collection contains items that matches the predicate.
haveCount(int expected) IterableAssertions<T>
Asserts that the number of items in the collection matches the supplied expected amount.
isEqual(Iterable<T> expected) bool
Comparison with an another expected value
override
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