use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ScopedAnnotationInjectionTest 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(ApplicationScopedClass.class).to(ApplicationScopedClassImpl.class);
bind(ContextScopedClass.class).to(ContextScopedClassImpl.class);
bind(DependentScopedClass.class).to(DependentScopedClassImpl.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class FieldListenerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bindFieldListener(TestAnnotation.class, FieldListenerTest.this);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ProviderListenerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
mMockApplication = new MockApplication();
Proton.initialize(mMockApplication, new DefaultModule() {
@Override
protected void configure() {
super.configure();
bindProviderListener(ProviderListenerTest.this);
bind(Aaa.class);
}
});
mInjector = Proton.getInjector(new MockContext(mMockApplication));
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ApplicationScopedInjectionTest 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(ApplicationScopedClass.class).in(ApplicationScoped.class);
bind(IllegalApplicationScopedClass.class).in(ApplicationScoped.class);
bind(ContextScopedClass.class);
}
});
}
use of android.test.mock.MockApplication in project AndroidTraining by mixi-inc.
the class ConstructorInjectionTest 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));
}
Aggregations