use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class DependentInjectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bind(Client.class);
bind(Aaa.class).in(Dependent.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class FieldInjectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bind(Client.class);
bind(Aaa.class).to(AaaImp.class);
bind(Bbb.class).to(BbbImp.class);
bind(Ccc.class).to(CccImp.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ImplicitInjectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class InjectorInjectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bind(ApplicationClient.class).in(ApplicationScoped.class);
bind(Client.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ProviderInjectionTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bind(Aaa.class).toProvider(new AaaProvider());
bind(Bbb.class).in(ApplicationScoped.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
Aggregations