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
Anmol Verma
10/01/2023, 4:05 AM
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