I'm trying to unit test my use cases coroutines us...
# android-architecture
l
I'm trying to unit test my use cases coroutines using mockk but I don't know how to do the verification of a lambda. I have the gists of the test and the base class. Anyone has experience with this kind of testing? https://gist.github.com/leodeleon22/e22e7954f70ce77f2fdfdbbb854293a6 https://gist.github.com/leodeleon22/640c42ecd86ccde8986bd0541bc4b45d
d
First of all I do not like the idea of tying your use case classes to your threading implementation. In my experience it causes undue complication to the code because of it being a leaky abstraction. For the full reasoning please take the time to watch this video by Mark Seeman:

https://youtu.be/F9bznonKc64

Even if you do not agree it's good to get other opinions.
TLDR: Inject behavior (AKA the UseCase class) into the asynchronous function.