Hi everyone. Does anybody have idea how to mock ob...
# android
n
Hi everyone. Does anybody have idea how to mock object classes in android?
t
if you mean mocking Kotlin objects for testing... https://mockk.io/
n
I mean mocking a singleton class which is defined like this :
Copy code
object Singleton{}
b
didn't do that for a while, but most like powermock library still do that
t
n
@Tgo1014 Thanks a lot I'll try this. Also, is this not recommended to have singletons becuase they are hard to mock?
t
I don't think it's hard to mock. Anything has it uses you just need to see what works better for each situation.
n
Thanks. Got it
I'll try this Lib and will get back here
t