https://kotlinlang.org logo
#announcements
Title
# announcements
f

fstn

12/02/2017, 5:55 AM
Hi, what’s the best mock library for Kotlin? What is the best way to mock that:
Copy code
object ContextManagerFactory {
    fun get(): ContextManager {
r

rkeazor

12/02/2017, 12:57 PM
Mockito 2
or perhaps powermock for that senario. since its somewhat like a static
f

fstn

12/02/2017, 12:59 PM
thanks, is it able to mock suspend function?
r

rkeazor

12/02/2017, 1:00 PM
as in courutines?
i think as long as its public, suspend is not a access modifier so I can’t see why not
im not 100% sure , tho never tried. but isolation frameworks work as long as the function or method provided can be overriden
👍 1
f

fstn

12/02/2017, 1:05 PM
thanks 😉 lets try that
5 Views