How to do unit testing and functional testing on an Android app?
I have created an app that sends intents among multiple activities. After doing some research I have found that the ActivityUnitTestCase class is designed for unit testing while the ActivityInstrumentationTestCase2 is designed for functional testing. I understand the use of methods such as setUp(), tearDown(), and testPreConditions(). However I am having a little difficulty in trying to figure out what user-defined-tests to create in the previously mentioned classes. I know that there are a few methods that cannot be called in certain classes.
To be more specific, if I am in activity A and I click a button then it calls startActivityForResult() which starts activity B. I then send an intent back to activity A which is handled in the onActivityResult() method. How can I test that the actual result in onActivityResult() is equal to the expected result?
I have been looking extensively for any kind of examples that would help clear up this confusion. If anyone could provide any assistance I would greatly appreciate it.