MockableFunction class
Constructors
- MockableFunction([dynamic value])
Properties
-
callArgs
↔ List<
CallArgs?> -
getter/setter pairinherited
- callCount ↔ int
-
getter/setter pairinherited
- called → bool
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
history
→ List<
CallArgs?> -
no setterinherited
- originalValue → dynamic
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ dynamic
-
getter/setter pair
Methods
-
call(
[List? args, Map< String, dynamic> ? namedArgs]) → dynamic -
Returns the mocked value.
argsandnamedArgsshould be provided if the mocked function takes arguments.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
{dynamic pausedValue, bool respectNextCall = false}) → void -
Pauses incrementing the call count. Call args will not be recorded. The
default value will be used unless
pausedValueis provided.inherited -
reset(
{bool clearValue = true, bool clearArgs = true, bool clearCount = true}) → void -
Reverts all to the original values, so resets the call count, clears call
args, and clears out any next calls.
inherited
-
resume(
) → void -
Resumes incrementing the call count after pausing.
inherited
-
returnNextCall(
dynamic value) → void -
The next time this function is called, return
value. It will return to the original value after the next call is made.inherited -
throwNextCall(
[Exception? e]) → void -
The next time this function is called, throw
e. Ifeis not provided, this will throw 'Mocked exception'.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited