RockyGlobal
RockyGlobal

Reputation: 595

I am trying to convert a java unittest case mockito to Kotlin MockK in android

This is the verify block and was working on java

verify(mockTokenError) {}

And later tried to convert to kotlin

verify{mockTokenError()}

also tried

verify{mockTokenError}

none of them works please let me know solution.

Upvotes: 0

Views: 165

Answers (1)

Demigod
Demigod

Reputation: 5635

So the verify block checks all method calls (which were made with the mocked object) that are inside its block. For example,

val car = mockk<Car>()

verify { car.stop() }

More info - https://mockk.io/#verification-atleast-atmost-or-exactly-times

Upvotes: 1

Related Questions