ctx
context(scope: MokkeryTemplatingScope)
inline fun <A, R> ctx(a: A, block: context(A) () -> R): R(source)
inline fun <A, R> ctx(a: A, block: context(A) () -> R): R(source)
context(scope: MokkeryTemplatingScope)
inline fun <A, B, R> ctx(a: A, b: B, block: context(A, B) () -> R): R(source)
inline fun <A, B, R> ctx(a: A, b: B, block: context(A, B) () -> R): R(source)
context(scope: MokkeryTemplatingScope)
inline fun <A, B, C, R> ctx(a: A, b: B, c: C, block: context(A, B, C) () -> R): R(source)
inline fun <A, B, C, R> ctx(a: A, b: B, c: C, block: context(A, B, C) () -> R): R(source)
context(scope: MokkeryTemplatingScope)
inline fun <A, B, C, D, R> ctx(a: A, b: B, c: C, d: D, block: context(A, B, C, D) () -> R): R(source)
inline fun <A, B, C, D, R> ctx(a: A, b: B, c: C, d: D, block: context(A, B, C, D) () -> R): R(source)
context(scope: MokkeryTemplatingScope)
inline fun <A, B, C, D, E, R> ctx(a: A, b: B, c: C, d: D, e: E, block: context(A, B, C, D, E) () -> R): R(source)
inline fun <A, B, C, D, E, R> ctx(a: A, b: B, c: C, d: D, e: E, block: context(A, B, C, D, E) () -> R): R(source)
context(scope: MokkeryTemplatingScope)
inline fun <A, B, C, D, E, F, R> ctx(a: A, b: B, c: C, d: D, e: E, f: F, block: context(A, B, C, D, E, F) () -> R): R(source)
inline fun <A, B, C, D, E, F, R> ctx(a: A, b: B, c: C, d: D, e: E, f: F, block: context(A, B, C, D, E, F) () -> R): R(source)
Allows mocking methods with context parameters.
Example:
interface Foo {
context(ctx: Int)
fun foo(): Int
}
val mock = mock<Foo>()
every { ctx(any<Int>()) { mock.foo() } } returnsArgAt 0Content copied to clipboard