DEV Community

Discussion on: Android testing help

Collapse
corentinleffy profile image
Corentin Leffy • Edited

Jean-Michel is right : Android Test is difficult and you have to extract your business logic outside of Android to not be too coupled with the framework.

To complete, I suggest you to check this Google Codelabs : it covers the basics of running and writing tests for Android. You can do the next two Codelabs after that to complete what you learned in the first one (this is all about testing, DI, mock, ...).

Thread Thread
fultonbrowne profile image
Fulton Browne Author

Thanks I have extracted as much logic outside the activity as possible but one of the main components of my app NEEDS activity context. completely testing this part will get me to around 65% code coverage (and my project is BIG). I cant find a way to pass the an activity to the method, any tips?