private static class HomeActivityTestRule extends IntentsTestRule { | |
private HomeActivityTestRule() { | |
super(HomeActivity.class); | |
} | |
@Override public void beforeActivityLaunched() { | |
Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation(); | |
ShowAndHideApplication app = | |
(ShowAndHideApplication) instrumentation.getTargetContext().getApplicationContext(); | |
ShowAndHideTestComponent component = DaggerShowAndHideTestComponent.builder() | |
.mockFileUtilitiesModule(new MockFileUtilitiesModule()) | |
.mockImageProcessorModule(new MockImageProcessorModule()) | |
.build(); | |
app.setComponent(component); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment