JAVA 43
Untitled By Guest on 28th November 2017 01:23:31 PM
  1.     @Rule public DaggerMockRule<ApplicationComponent> daggerRule =
  2.             new DaggerMockRule<>(ApplicationComponent.class, new MockDatabaseModule(), new DataModule(application),
  3.                     new ApplicationModule(application)).set(
  4.                     component -> {
  5.                         MyApplication app =
  6.                                 (MyApplication) InstrumentationRegistry.getInstrumentation()
  7.                                         .getTargetContext()
  8.                                         .getApplicationContext();
  9.                         app.setComponent(component);
  10.                     });
  11.  
  12.     @Rule
  13.     public final DaggerMockRule<FeedPresenterComponent> rule = new DaggerMockRule<>(
  14.                 FeedPresenterComponent.class, new FeedDataSourceModule(),
  15.                 new FeedDownloadImageUseCaseModule(), new FeedServiceModule(),  new FeedPresenterModule(null))
  16.             .addComponentDependency(ApplicationComponent.class, new ApplicationModule(application), new DataModule(application))
  17.             .set(component -> {
  18.                 localDataSource = component.localDataSource();
  19.             });
  20.  
  21.     @Mock FeedDao feedDao;
  22.  
  23.     @Mock FeedLocalDataSource localDataSource;
  24.  
  25.     @Mock NetworkUtils networkUtils;

Paste is for source code and general debugging text.

Login or Register to delete or keep track of your pastes.