MockableContainer class final

A CapsuleContainer that additionally allows you to mock capsules as a convenience when testing.

WARNING

Only use a MockableContainer within your tests!

Inheritance
Available extensions

Constructors

MockableContainer()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Disposes any resources associated with this object.
inherited
listen(CapsuleListener listener) → void Function()
Temporarily listens to changes in a given set of Capsules.
inherited
mock<T>(Capsule<T> capsule) MockBuilder<T>
Creates a MockBuilder for this MockableContainer and the supplied capsule.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onNextUpdate<T>(Capsule<T> capsule, void callback()) → void Function()
Runs the supplied callback the next time capsule is updated or disposed.
inherited
read<T>(Capsule<T> capsule) → T
Reads the current data of the supplied Capsule, initializing it if needed.
inherited
runTransaction(void sideEffectTransaction()) → void
Runs the supplied sideEffectTransaction that combines all side effect state updates into a single container rebuild sweep. These state updates can originate from the same or different capsules, enabling you to make transactional side effect changes across capsules.
inherited
toString() String
A string representation of this object.
inherited

Operators

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