FunProxy

Shared Properties of synchronous and asynchronous functions Proxies.

Author

Matthias Geisler

Parameters

ReturnValue

the return value of the Function.

SideEffect

the function signature.

Functions

Link copied to clipboard
abstract fun clear()

Clears the Proxies captured arguments

Link copied to clipboard
abstract operator fun get(callIndex: Int): Array<out Any?>

Alias for getArgumentsForCall

Link copied to clipboard
abstract fun getArgumentsForCall(callIndex: Int): Array<out Any?>

Resolves given arguments of an invocation.

Link copied to clipboard
abstract infix override fun returns(value: ReturnValue)

Alias setter of returnValue.

Link copied to clipboard
abstract infix override fun returnsMany(values: List<ReturnValue>)

Alias setter of returnValues.

Link copied to clipboard
abstract infix fun run(action: SideEffect)

Alias method for sideEffect

Link copied to clipboard

Convenient method for multiple SideEffects, which uses under the sideEffects property. This chains SideEffects together according to their given order.

Link copied to clipboard
abstract infix fun throws(error: Throwable)

Alias setter of error.

Link copied to clipboard
abstract infix fun throwsMany(errors: List<Throwable>)

Alias setter of errors.

Properties

Link copied to clipboard
abstract val calls: Int

Counter of the actual invocations of the Proxy.

Link copied to clipboard
abstract var error: Throwable

Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.

Link copied to clipboard
abstract var errors: List<Throwable>

Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy. If the given List has a smaller size than the actual invocation the last value of the list is used for any further invocation.

Link copied to clipboard
abstract val frozen: Boolean

Indicates that the proxies uses the frozen memory model.

Link copied to clipboard
abstract val id: String

Unique Id of the Proxy derived from the Interface which it build upon.

Link copied to clipboard
abstract val ignorableForVerification: Boolean

Marks the Proxy as ignore during verification (e.g. build-in methods). Intended for internal usage only!

Link copied to clipboard
abstract var returnValue: ReturnValue

Setter/Getter in order to set/get constant ReturnValue of the function.

Link copied to clipboard
abstract var returnValues: List<ReturnValue>

Setter/Getter in order to set/get a List of ReturnValues of the Proxy. If the given List has a smaller size than the actual invocation the last value of the list is used for any further invocation.

Link copied to clipboard
abstract var sideEffect: SideEffect

Setter/Getter in order to set/get a custom SideEffect for the function. SideEffects can be used for fine grained behaviour of a Proxy on invocation.

Link copied to clipboard

SideEffectChainBuilder to chain multiple SideEffects.

Link copied to clipboard
abstract var throws: Throwable

Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.

Link copied to clipboard
abstract var throwsMany: List<Throwable>

Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy. If the given List has a smaller size than the actual invocation the last value of the list is used for any further invocation.

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
inline fun <T : Any> KMockContract.FunProxy<*, *>.getAllArgumentsBoxedByType(): List<List<T>>

Retrieves arguments for given type of FunProxy, while boxing them in sub lists for each call.

Link copied to clipboard
inline fun <T : Any> KMockContract.FunProxy<*, *>.getAllArgumentsByType(): List<T>

Retrieves arguments for given type of FunProxy.

Link copied to clipboard
inline fun <T : Any> KMockContract.FunProxy<*, *>.getArgumentsByType(callIndex: Int): List<T>

Retrieves arguments of a call at a given index for a given type of FunProxy.