FunctionScope

Provides a set of mocked function related operations that might be required for implementing Answer.

Properties

Link copied to clipboard
val args: List<Any?>

Args passed to mocked method. If method has extension receiver it is passed at the start of this list.

Link copied to clipboard

Return type of mocked method.

Link copied to clipboard
val self: Any?

Reference to this mock.

Link copied to clipboard

This map contains available super calls as lambdas of type (List<Any?>) -> Any? or suspend (List<Any?>) -> Any? depending on a function type.

Functions

Link copied to clipboard
inline fun <T> arg(index: Int): T

Returns argument with index from args and expects that it is an instance of type T.

Link copied to clipboard
fun callOriginal(args: List<Any?>): Any?

Calls original method implementation with given args.

Link copied to clipboard
fun callSuper(superType: KClass<*>, args: List<Any?>): Any?

Calls super method of superType with given args

Link copied to clipboard
suspend fun callSuspendOriginal(args: List<Any?>): Any?

Just like callOriginal but for suspend calls.

Link copied to clipboard
suspend fun callSuspendSuper(superType: KClass<*>, args: List<Any?>): Any?

Just like callSuper but for suspend calls.