MockKStubScope

class MockKStubScope<T, B>(    answerOpportunity: MockKGateway.AnswerOpportunity<T>,     callRecorder: MockKGateway.CallRecorder,     lambda: CapturingSlot<Function<*>>)

Stub scope. Part of DSL

Allows to specify function result

Constructors

Link copied to clipboard
fun <T> MockKStubScope(    answerOpportunity: MockKGateway.AnswerOpportunity<T>,     callRecorder: MockKGateway.CallRecorder,     lambda: CapturingSlot<Function<*>>)

Functions

Link copied to clipboard
infix fun answers(answer: Answer<T>): MockKAdditionalAnswerScope<T, B>
infix fun answers(answer: MockKAnswerScope<T, B>.(Call) -> T): MockKAdditionalAnswerScope<T, B>
Link copied to clipboard
infix fun coAnswers(answer: suspend MockKAnswerScope<T, B>.(Call) -> T): MockKAdditionalAnswerScope<T, B>
Link copied to clipboard
infix fun <K : Any> nullablePropertyType(cls: KClass<K>): MockKStubScope<T, K?>
Link copied to clipboard
infix fun <K : Any> propertyType(cls: KClass<K>): MockKStubScope<T, K>
Link copied to clipboard
infix fun returns(returnValue: T): MockKAdditionalAnswerScope<T, B>
Link copied to clipboard
infix fun returnsArgument(n: Int): MockKAdditionalAnswerScope<T, B>

Returns the nth argument of what has been called.

Link copied to clipboard
fun returnsMany(vararg values: T): MockKAdditionalAnswerScope<T, B>
infix fun returnsMany(values: List<T>): MockKAdditionalAnswerScope<T, B>
Link copied to clipboard
infix fun throws(ex: Throwable): MockKAdditionalAnswerScope<T, B>

Extensions

Link copied to clipboard
infix fun MockKStubScope<Unit, Unit>.just(runs: Runs): MockKAdditionalAnswerScope<Unit, Unit>

Part of DSL. Answer placeholder for Unit returning functions.