views:

41

answers:

1

I have an Activity I would like to automate testing on. The start up of the Activity is like this:

  • Get data from Intent
  • Bind to service and obtain some objects specific to that Activity's intent data
  • Query these objects and print information to screen

I have a basic grasp of testing Activities but given how this Activity depends quite heavily on a Service and other objects, I'm unsure how to start testing it. Ideally, the service would also be set up during testing to return only data pre-defined by me.

A: 

From the Android Documentation

With instrumentation, Android can automate UI testing by sending events to the application under test, precisely control the start of an activity, and monitor the state of the activity during its life cycle.

I think should able to get something going with InstrumentationTestCase, I have done some very basic testing using it

Aaron Saunders