Examples for writing test cases in an Android app
Refer to these articles for step by step explanation of writing these test cases.
How To Improve Coverage for your Android App Using Mockito and Espresso — Part 1
How To Improve Coverage for your Android App Using Mockito and Espresso — Part 2