SyncFunProxy

Synchronous function Proxy in order to stub/mock synchronous function behaviour.

Author

Matthias Geisler

Parameters

ReturnValue

the value type of the hosting PropertyProxy.

SideEffect

the function signature.

Functions

clear
Link copied to clipboard
common
abstract fun clear()
Clears the Proxies captured arguments
get
Link copied to clipboard
common
abstract operator fun get(callIndex: Int): Array<out Any?>
Alias for getArgumentsForCall
getArgumentsForCall
Link copied to clipboard
common
abstract fun getArgumentsForCall(callIndex: Int): Array<out Any?>
Resolves given arguments of an invocation.
returns
Link copied to clipboard
common
abstract infix override fun returns(value: ReturnValue)
Alias setter of returnValue.
returnsMany
Link copied to clipboard
common
abstract infix override fun returnsMany(values: List<ReturnValue>)
Alias setter of returnValues.
run
Link copied to clipboard
common
abstract infix fun run(action: SideEffect)
Alias method for sideEffect
runs
Link copied to clipboard
common
abstract infix fun runs(action: SideEffect): KMockContract.ProxySideEffectBuilder<ReturnValue, SideEffect>
Convenient method for multiple SideEffects, which uses under the sideEffects property.
throws
Link copied to clipboard
common
abstract infix fun throws(error: Throwable)
Alias setter of error.
throwsMany
Link copied to clipboard
common
abstract infix fun throwsMany(errors: List<Throwable>)
Alias setter of errors.

Properties

calls
Link copied to clipboard
common
abstract val calls: Int
Counter of the actual invocations of the Proxy.
error
Link copied to clipboard
common
abstract var error: Throwable
Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.
errors
Link copied to clipboard
common
abstract var errors: List<Throwable>
Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.
frozen
Link copied to clipboard
common
abstract val frozen: Boolean
Indicates that the proxies uses the frozen memory model.
id
Link copied to clipboard
common
abstract val id: String
Unique Id of the Proxy derived from the Interface which it build upon.
ignorableForVerification
Link copied to clipboard
common
abstract val ignorableForVerification: Boolean
Marks the Proxy as ignore during verification (e.g.
returnValue
Link copied to clipboard
common
abstract var returnValue: ReturnValue
Setter/Getter in order to set/get constant ReturnValue of the function.
returnValues
Link copied to clipboard
common
abstract var returnValues: List<ReturnValue>
Setter/Getter in order to set/get a List of ReturnValues of the Proxy.
sideEffect
Link copied to clipboard
common
abstract var sideEffect: SideEffect
Setter/Getter in order to set/get a custom SideEffect for the function.
sideEffects
Link copied to clipboard
common
abstract val sideEffects: KMockContract.SideEffectChainBuilder<ReturnValue, SideEffect>
SideEffectChainBuilder to chain multiple SideEffects.
throws
Link copied to clipboard
common
abstract var throws: Throwable
Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.
throwsMany
Link copied to clipboard
common
abstract var throwsMany: List<Throwable>
Setter/Getter in order to set/get a constant error which is thrown on the invocation of the Proxy.