Created
February 16, 2017 20:04
-
-
Save ralphpina/a0959dca675bed7a73f1fac71a0aeb9f to your computer and use it in GitHub Desktop.
instrumentation test rule example
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 final TestComponentRule component = new TestComponentRule.Builder() | |
.withClient() | |
.withUserManager(true) | |
.build(); | |
public final ActivityTestRule<MainActivity> activity = new ActivityTestRule<>( | |
MainActivity.class, | |
false, | |
false); | |
// TestComponentRule needs to go first to make sure the Dagger ApplicationTestComponent is set | |
// in the Application before any Activity is launched. | |
@Rule | |
public TestRule chain = RuleChain.outerRule(component) | |
.around(activity); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment