Created
April 25, 2016 10:00
-
-
Save catehstn/7068675fda95b0fb6a375fddbd31c8b2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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