FunctionMock class

Mock function definition.

Mocks must refer to a function declared by the target service. The type of the function args and result will be inferred at test time. If either the arg or result values are not compatible with function type declaration, the request will be considered invalid. More than one FunctionMock may be provided for a given function name so long as the Arg matchers are distinct. There may be only one function for a given overload where all Arg values are Arg.any_value.

Constructors

FunctionMock({List<Arg>? args, String? function, Result? result})
FunctionMock.fromJson(Map _json)

Properties

args List<Arg>?
The list of Arg values to match.
getter/setter pair
function String?
The name of the function.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
result Result?
The mock result of the function call.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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