-
-
Save jabKnowsNothing/b141a4fdf260a7a4a6a2 to your computer and use it in GitHub Desktop.
Old example test case with ActivityInstrumentationTestCase2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyOldTest extends ActivityInstrumentationTestCase2<MyActivity> { | |
public MyOldTest() { | |
super(MyActivity.class); | |
} | |
@Override | |
protected void onSetUp(Context context) { | |
super.onSetUp(context); | |
// Do all my test set up here | |
Intent myCustomIntent = new Intent(); | |
// Add extras and stuff | |
// Maybe prepare some mock service calls | |
// Maybe override some depency injection modules with mocks | |
setActivityIntent(myCustomIntent); | |
getActivity(); // launch activity under test | |
} | |
@Override | |
protected void tearDown() { | |
// destroy stuff | |
} | |
public void testStuff() { | |
// Verify Oscar Grouch is grouchy | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment