Created
July 28, 2020 11:43
-
-
Save arkivanov/51a1bf34e76ab40526ce8a4a78981d52 to your computer and use it in GitHub Desktop.
KittenComponentTest2
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
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