Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class AppRepositoryInjectTest {
@Inject
lateinit var appAPIs: AppAPIs
@Before
fun setUp() {
val component = DaggerTestAppComponent.builder()
.applicationModule(TestApplicationModule(GDelegate()))
.build()
component.into(this)
}
@Test
fun `my test`() {
assertNotNull(appAPIs)
/* Given */
every { appAPIs.getForecastTempWithUrl("r") } returns Flowable.just(APIResponse())
/* When */
val result = appAPIs.getForecastTempWithUrl("r")
/* Then */
result
.test()
.assertValue(APIResponse())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.