Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Created July 28, 2020 11:43
Show Gist options
  • Save arkivanov/51a1bf34e76ab40526ce8a4a78981d52 to your computer and use it in GitHub Desktop.
Save arkivanov/51a1bf34e76ab40526ce8a4a78981d52 to your computer and use it in GitHub Desktop.
KittenComponentTest2
class KittenComponentTest {
private val dataSourceScheduler = TestScheduler()
private val dataSource = TestKittenDataSource(dataSourceScheduler)
private val view = TestKittenView()
private fun startComponent(): KittenComponent =
KittenComponent(dataSource).apply {
onViewCreated(view)
onStart()
}
// ...
@BeforeTest
fun before() {
overrideSchedulers(main = { TestScheduler() }, computation = { TestScheduler() })
}
@AfterTest
fun after() {
overrideSchedulers()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment