Slide 38
Slide 38 text
/* :lib.weatherdata /src/main */
interface WeatherRepository {
suspend fun getForecast(): List
}
/* :app /src/androidTest */
@ContributesBinding(
scope = WeatherScope::class,
replaces = [WeatherRepositoryImpl::class]
)
object FakeWeatherRepository : WeatherRepository {
override suspend fun getForecast(): List = listOf(1, 2, 3, 4, 5)
}
Anvil - Replace dependencies in tests