DaggerMock
DaggerMock copied to clipboard
Mock dependencies in both parent and child component in espresso test?
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.
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