Hi, if i did want to write activity/fragment tests, whats the best way? Mock the viewmodel and what it exposes or directly call the render/sideeffect methods or something else?
b
Benoît
03/28/2022, 2:44 PM
I would use a real ViewModel but inject mock dependencies through its constructor.
This way you can control what IO does (network, disk, db, etc)
Benoît
03/28/2022, 2:46 PM
But I guess it depends on what you're trying to test. If you just want to check the UI you can probably call the render directly