use of com.karumi.rosie.sample.main.MainApplication in project Rosie by Karumi.
the class InjectedInstrumentationTest method getApplication.
private MainApplication getApplication() {
Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
MainApplication app = (MainApplication) instrumentation.getTargetContext().getApplicationContext();
return app;
}
use of com.karumi.rosie.sample.main.MainApplication in project Rosie by Karumi.
the class InjectedInstrumentationTest method tearDown.
@After
public void tearDown() throws Exception {
List<IdlingResource> idlingResources = getIdlingResources();
for (IdlingResource resource : idlingResources) {
unregisterIdlingResources(resource);
}
MainApplication application = getApplication();
application.resetFakeGraph();
}
use of com.karumi.rosie.sample.main.MainApplication in project Rosie by Karumi.
the class InjectedInstrumentationTest method setUp.
@Before
public void setUp() {
MainApplication application = getApplication();
List<Object> childTestModules = getTestModules();
Context context = InstrumentationRegistry.getInstrumentation().getTargetContext();
List<Object> testModules = new LinkedList<>(childTestModules);
testModules.add(new BaseTestModule(context));
ObjectGraph objectGraph = application.plusGraph(testModules);
application.replaceGraph(objectGraph);
objectGraph.inject(this);
}
Aggregations