Stub

A BaseMethodMock.Stub for suspending methods.

Constructors

Link copied to clipboard
constructor(matchers: M)

Properties

Link copied to clipboard
open override val matchers: M

Functions

Link copied to clipboard
suspend fun call(values: V): R

Calls this stub with a given set of values

Link copied to clipboard
fun doAnswer(answer: SuspendedAnswer<V, R>)

Sets the answer for this stub to a given answer.

Link copied to clipboard
fun doAwait(deferred: Deferred<R>): Deferred<V>

Sets the answer await and return the value of a given Deferred.

Link copied to clipboard
fun doExecute(action: (V) -> R)

Sets the answer to execute a given code block.

Link copied to clipboard
fun doExecuteSuspended(action: suspend (V) -> R)

Sets the answer to execute a given suspended code block.

Link copied to clipboard
fun doReturn(value: R)

Sets the answer to return a given value.

Link copied to clipboard
fun doThrow(throwable: Throwable)

Sets the answer to throw a given Throwable