Last active
February 9, 2021 12:06
-
-
Save prokash-sarkar/252b9d068b109f9a8931a08495356b13 to your computer and use it in GitHub Desktop.
This Gist is a part of the Article: https://prokash-sarkar.medium.com/unit-testing-with-dagger-2-brewing-a-potion-with-fakes-mocks-and-custom-rules-in-android-7f0ab7b22cb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Singleton | |
@Component( | |
modules = [ | |
AndroidInjectionModule::class, NetworkModule::class, | |
TestAppModule::class, AppModuleBinds::class, | |
ViewModelBuilderModule::class, ActivityBuildersModule::class | |
] | |
) | |
interface TestAppComponent : AppComponent { | |
@Component.Factory | |
interface Factory { | |
fun create(@BindsInstance applicationContext: Context): TestAppComponent | |
} | |
fun inject(app: TestBaseApplication) | |
fun inject(test: DefaultDataRepositoryTest) // Required for field injection from the test class | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment