Anyone has any idea to write a unit test for this ...
# testing
t
Anyone has any idea to write a unit test for this ViewModel file? I appreciate if you can give me an example code or any keyword for me to search the issue? Thank you very much
a
It’s an android viewmodel and it needs application instance. What’s stopping you from extending ViewModel instead ? Also if the service uses a retrofit service then you can use mockwebserver to fake responses for unit tests