Skip to content

Instantly share code, notes, and snippets.

@tugceaktepe
Last active June 15, 2023 19:45
Show Gist options
  • Save tugceaktepe/a3dfab5ce4c250b39fe01e1f8ab16b66 to your computer and use it in GitHub Desktop.
Save tugceaktepe/a3dfab5ce4c250b39fe01e1f8ab16b66 to your computer and use it in GitHub Desktop.
Replace a binding
@UninstallModules(
UrlModule::class
)
@HiltAndroidTest
@RunWith(AndroidJUnit4::class)
class MainActivityTest {
@get:Rule
val hiltRule = HiltAndroidRule(this)
@Module
@InstallIn(SingletonComponent::class)
class FakeBaseUrlModule {
@Provides
@Singleton
fun provideUrl(): String = "http://127.0.0.1:8080/"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment