Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import android.app.Activity;
- import android.content.Context;
- import android.content.Intent;
- import android.test.ActivityUnitTestCase;
- public class MainActivityUnitTest extends ActivityUnitTestCase<MainActivity> {
- private Intent _startIntent;
- public MainActivityUnitTest() {
- super(MainActivity.class);
- }
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- Context targetContext = getInstrumentation().getTargetContext();
- //Set your theme
- targetContext.setTheme(R.style.AppTheme);
- setActivityContext(targetContext);
- _startIntent = new Intent(Intent.ACTION_MAIN);
- }
- public void testPreconditions() {
- startActivity(_startIntent, null, null);
- assertNotNull(getActivity());
- }
- }
Add Comment
Please, Sign In to add comment