|
|
@ -17,6 +17,7 @@
|
|
|
|
package com.google.samples.apps.nowinandroid.core.testing.di
|
|
|
|
package com.google.samples.apps.nowinandroid.core.testing.di
|
|
|
|
|
|
|
|
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.Dispatcher
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.Dispatcher
|
|
|
|
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.Default
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.di.DispatchersModule
|
|
|
|
import com.google.samples.apps.nowinandroid.core.network.di.DispatchersModule
|
|
|
|
import dagger.Module
|
|
|
|
import dagger.Module
|
|
|
@ -35,4 +36,10 @@ object TestDispatchersModule {
|
|
|
|
@Provides
|
|
|
|
@Provides
|
|
|
|
@Dispatcher(IO)
|
|
|
|
@Dispatcher(IO)
|
|
|
|
fun providesIODispatcher(testDispatcher: TestDispatcher): CoroutineDispatcher = testDispatcher
|
|
|
|
fun providesIODispatcher(testDispatcher: TestDispatcher): CoroutineDispatcher = testDispatcher
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
|
|
|
|
@Dispatcher(Default)
|
|
|
|
|
|
|
|
fun providesDefaultDispatcher(
|
|
|
|
|
|
|
|
testDispatcher: TestDispatcher,
|
|
|
|
|
|
|
|
): CoroutineDispatcher = testDispatcher
|
|
|
|
}
|
|
|
|
}
|
|
|
|