Mgj
08/17/2020, 7:40 AMfun testDummyImpl(input: String): String {
if (mRetryCounter > MAX_RETRY_COUNT) {
return ""
} else {
mRetryCounter++
return testDummyImpl(input)
}
}
fun testDummy(input: String): String {
return testDummyImpl(input)
}
that i test with:
@Test
fun testDummy() {
runBlockingTest {
val sut = MySystemUnderTest()
try {
val dummyResult = sut.testDummy("Input")
} catch (e: Exception) {
var debug = 42
debug++
}
verify(exactly = 3) {
sut.testDummyImpl(any())
}
}
}
The test fails with One matching call found, but needs at least 3 and at most 3 calls
even though its clearly called 3 times (double-checked with a debugger). What gives?