AndroidTestCase basics


A quick blog on its basics. Its a bit crazy to read the developer.android.com site for this. So, you create a AndroidTestCase when you want to test a android application from test cases. So you have a screen with some data, buttons. Your test case will fill in the data, and press the buttons. Infact you can also call methods of your classes.

Now you ask, where will the test case get the application context for that app. Simple, when you set up a project with a class that extends AndroidTestCase, you also need to put in the following to your manifest. The test case launches and loads your applications and you can get a reference to your app context from super.getContext(). Cool ?? I think so..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s