Android unit test/test.runner - access to Application object -
I am using the Android test.runner library and AndroidTestCase etc. to create some unit tests. I find this useful, but access to the application object for a test is required. Generally I only meet the context of that activity, eg. However, the unit is in test class, which extends AndroidText Seeds, and as far as I can see, a GetApplicationContext is not available. There is a getContext, but it is not clear if I want this. What is the best way to act? Are you testing your applet object, or testing something else that depend on it? Trying? If you are not testing upstate at this frequency, then you can use an instrument like mokoos to copy an applet object for your testing purposes. AppState AppState = (myActivity.getApplicationContext (applet););
Comments
Post a Comment