PropertyProxy

Proxy in order to stub/mock property behaviour.

Author

Matthias Geisler

Parameters

Value

the value type of the hosting PropertyProxy.

Functions

Link copied to clipboard
abstract fun clear()

Clears the Proxies captured arguments

Link copied to clipboard
abstract operator fun get(callIndex: Int): KMockContract.GetOrSet

Alias for getArgumentsForCall

Link copied to clipboard
abstract fun getArgumentsForCall(callIndex: Int): KMockContract.GetOrSet

Resolves given arguments of an invocation.

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

Alias setter of get.

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

Alias getMany get.

Link copied to clipboard
abstract infix fun runOnGet(sideEffect: () -> Value)

Alias setter of getSideEffect.

Link copied to clipboard
abstract infix fun runOnSet(sideEffect: (Value) -> Unit)

Alias setter of set.

Properties

Link copied to clipboard
abstract val calls: Int

Counter of the actual invocations of the Proxy.

Link copied to clipboard
abstract val frozen: Boolean

Indicates that the proxies uses the frozen memory model.

Link copied to clipboard
abstract var get: () -> Value

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

Link copied to clipboard
abstract var getMany: List<Value>
Link copied to clipboard
abstract var getValue: Value

Setter/Getter in order to set/get constant Value of the property.

Link copied to clipboard
abstract var getValues: List<Value>

Setter/Getter in order to set/get a List of Values of the property. 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 id: String

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

Link copied to clipboard
abstract var set: (Value) -> Unit

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