Created
February 21, 2021 12:07
-
-
Save shredderskelton/2bdc705ce83cde06826eb4f548f71a08 to your computer and use it in GitHub Desktop.
Hot Flow Turbine
This file contains hidden or 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
| @Test | |
| fun `hot flow - Turbine`() { | |
| runBlocking { | |
| MutableStateFlow("test").test { | |
| assertThat(expectItem()).isEqualTo("test") | |
| cancelAndIgnoreRemainingEvents() | |
| } | |
| } | |
| } | |
| @Test | |
| fun `hot flow alternative - Turbine`() { | |
| runBlocking { | |
| MutableStateFlow("test").test { | |
| assertThat(expectItem()).isEqualTo("test") | |
| cancelAndConsumeRemainingEvents() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment