Skip to content

Instantly share code, notes, and snippets.

@ralphpina
Created February 16, 2017 20:04
Show Gist options
  • Save ralphpina/a0959dca675bed7a73f1fac71a0aeb9f to your computer and use it in GitHub Desktop.
Save ralphpina/a0959dca675bed7a73f1fac71a0aeb9f to your computer and use it in GitHub Desktop.
instrumentation test rule example
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