Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   How to do unit testing and functional testing on an Android app? (https://www.askmehelpdesk.com/showthread.php?t=531702)

  • Dec 4, 2010, 07:53 PM
    toobsco42
    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.

  • All times are GMT -7. The time now is 07:17 PM.