DaggerMock icon indicating copy to clipboard operation
DaggerMock copied to clipboard

Mock dependencies in both parent and child component in espresso test?

Open bnvinay92 opened this issue 5 years ago • 1 comments

Is it possible to mock dependencies in both the parent component and child component in an espresso test? Child components are being created using the builder.

bnvinay92 avatar Jul 08 '18 06:07 bnvinay92

Hi, it's possible if you use standard Dagges subcomponent (and not Dagger Android). Here you can find an example https://github.com/fabioCollini/DaggerMock/blob/master/RealWorldApp/src/androidTest/java/it/cosenonjaviste/daggermock/realworldapp/main/MainActivityMockPresenterTest.java

fabioCollini avatar Jul 15 '18 13:07 fabioCollini