MockableFunctionOf<T> class

Inheritance

Constructors

MockableFunctionOf(T 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 → T
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
getter/setter pair

Methods

call([List? args, Map<String, dynamic>? namedArgs]) → T
Returns the mocked value. args and namedArgs should be provided if the mocked function takes arguments.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause({T? pausedValue, bool respectNextCall = false}) → void
Pauses incrementing the call count. Call args will not be recorded. The default value will be used unless pausedValue is 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(T 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. If e is 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