oleksiyp
05/30/2018, 4:48 PMclass Cls {
fun op(a: Int, b: Int) = a + b
}
val factory = mockk<() -> Cls>()
every { factory().op(1, 2) } returns 2 andThen 4 andThen 5
println(factory().op(1, 2))
println(factory().op(1, 2))
println(factory().op(1, 2))
Usually in tests you have fixed number of factory objects, but again depends on your case