You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* AppComponent */
...
interface AppComponent {
fun inject(fooActivity: FooActivity)
@Component.Builder
interface Builder {
@BindsInstance
fun application(application: Application): Builder
fun appModule(appModule: AppModule): Builder
fun networkModule(networkModule: NetworkModule): Builder
fun build(): AppComponent
}
...
My Rule
val app: App get() = InstrumentationRegistry.getInstrumentation().targetContext.applicationContext as App
fun espressoDaggerMockRule() = DaggerMock.rule<AppComponent>(
AppModule(app),
MockNetworkModule() //doesn't use this class when I use AndroidInjection
) {
provides(MockNetworkModule())
set { component -> app.component = component; }
customizeBuilder<AppComponent.Builder> { it.application(app) }
}
daggermock: 0.8.4
dagger: 2.11
The text was updated successfully, but these errors were encountered:
Were u able to fix this, I can't seem to get the mocks working no build or runtime errors. I have a mix for kotlin and java. I think the problem is ModuleOverrider can't understand ActivityBuilder
When I use AndroidInjection the mock doesn't t work
Example
When I inject by AppComponent the mock is work
My Rule
daggermock: 0.8.4
dagger: 2.11
The text was updated successfully, but these errors were encountered: