Search in sources :

Example 1 with ObjectGraph

use of dagger.ObjectGraph in project Rutgers-Course-Tracker by tevjef.

the class CoursePresenterImplTest method setUp.

@Before
public void setUp() throws Exception {
    ObjectGraph og = ObjectGraph.create(new TestModule(), new MockModule());
    og.inject(this);
    coursePresenterImpl = new CoursePresenterImpl(TestConts.getPrimarySemesterRequest());
    og.inject(coursePresenterImpl);
}
Also used : ObjectGraph(dagger.ObjectGraph) TestModule(com.tevinjeffrey.rutgersct.TestModule) Before(org.junit.Before)

Example 2 with ObjectGraph

use of dagger.ObjectGraph in project Rutgers-Course-Tracker by tevjef.

the class SubjectPresenterImplTest method setUp.

@Before
public void setUp() throws Exception {
    ObjectGraph og = ObjectGraph.create(new TestModule(), new MockModule());
    og.inject(this);
    subjectPresenterImpl = new SubjectPresenterImpl(TestConts.getPrimarySemesterRequest());
    og.inject(subjectPresenterImpl);
}
Also used : ObjectGraph(dagger.ObjectGraph) TestModule(com.tevinjeffrey.rutgersct.TestModule) Before(org.junit.Before)

Example 3 with ObjectGraph

use of dagger.ObjectGraph in project Rutgers-Course-Tracker by tevjef.

the class TrackedSectionsPresenterImplTest method setUp.

@Before
public void setUp() throws Exception {
    ObjectGraph og = ObjectGraph.create(new TestModule(), new MockModule());
    og.inject(this);
    trackedSectionsPresenterImpl = new TrackedSectionsPresenterImpl();
    og.inject(trackedSectionsPresenterImpl);
}
Also used : ObjectGraph(dagger.ObjectGraph) TestModule(com.tevinjeffrey.rutgersct.TestModule) Before(org.junit.Before)

Example 4 with ObjectGraph

use of dagger.ObjectGraph in project dagger by square.

the class CoffeeApp method main.

public static void main(String[] args) {
    ObjectGraph objectGraph = ObjectGraph.create(new DripCoffeeModule());
    CoffeeApp coffeeApp = objectGraph.get(CoffeeApp.class);
    coffeeApp.run();
}
Also used : ObjectGraph(dagger.ObjectGraph)

Example 5 with ObjectGraph

use of dagger.ObjectGraph in project mortar by square.

the class ObjectGraphServiceTest method createMortarScopeUsesModules.

@Test
public void createMortarScopeUsesModules() {
    MortarScope scope = createRootScope(ObjectGraph.create(new AppleModule(), new BagelModule()));
    ObjectGraph objectGraph = getObjectGraph(scope);
    assertThat(objectGraph.get(HasApple.class).string).isEqualTo(Apple.class.getName());
    assertThat(objectGraph.get(HasBagel.class).string).isEqualTo(Bagel.class.getName());
    try {
        objectGraph.get(HasCarrot.class);
        fail("Expected IllegalArgumentException");
    } catch (IllegalArgumentException e) {
    // pass
    }
}
Also used : ObjectGraph(dagger.ObjectGraph) ObjectGraphService.getObjectGraph(mortar.dagger1support.ObjectGraphService.getObjectGraph) Test(org.junit.Test)

Aggregations

ObjectGraph (dagger.ObjectGraph)19 Test (org.junit.Test)8 Before (org.junit.Before)7 TestModule (com.tevinjeffrey.rutgersct.TestModule)6 ObjectGraphService.getObjectGraph (mortar.dagger1support.ObjectGraphService.getObjectGraph)6 BaseUnitTest (org.thoughtcrime.securesms.BaseUnitTest)2 SignalServiceMessageSender (org.whispersystems.signalservice.api.SignalServiceMessageSender)2 SignalServiceAddress (org.whispersystems.signalservice.api.push.SignalServiceAddress)2 Context (android.content.Context)1 LayoutInflater (android.view.LayoutInflater)1 ViewGroup (android.view.ViewGroup)1 MainApplication (com.karumi.rosie.sample.main.MainApplication)1 IOException (java.io.IOException)1 LinkedList (java.util.LinkedList)1 Matchers.anyString (org.mockito.Matchers.anyString)1 NotFoundException (org.whispersystems.signalservice.api.push.exceptions.NotFoundException)1 PushNetworkException (org.whispersystems.signalservice.api.push.exceptions.PushNetworkException)1