MockTask class
Creates an object that mocks a Task for testing purposes only
Constructors
- MockTask()
Properties
- error → dynamic
-
Returns task thrown error.
null
if task is still runningno setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- isAborted → bool
-
Returns true if the task has been aborted
no setteroverride
- isCancelled → bool
-
Returns true if the task has been cancelled
no setteroverride
- isRunning → bool
-
Returns true if the task hasn't yet returned or thrown an error
no setteroverride
- meta ↔ SagaMeta
-
Tasks meta data. It identifies saga.
getter/setter pairinherited
- result → dynamic
-
Returns task return value.
null
if task is still runningno setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
cancel(
) → void -
Cancels the task (If it is still running)
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAborted(
bool value) → void - Sets isAborted value
-
setCancelled(
bool value) → void - Sets isCancelled value
-
setContext(
Map< String, dynamic> context) → void -
Sets the task context.
It does not replace context, instead it extends tasks context with
provided
context
.override -
setError(
bool value) → void - Sets error value
-
setResult(
bool value) → void - Sets result value
-
setRunning(
bool value) → void - Sets isRunning value
-
toFuture(
) → Future -
Returns a Future which is either:
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited