Created
November 29, 2021 08:58
-
-
Save yasukotelin/1dc1588f8dc583f658deb5cc95d736a4 to your computer and use it in GitHub Desktop.
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
/** | |
* Eventに値が流れてきていないことをAssertする | |
*/ | |
suspend fun <T> FlowTurbine<T>.assertAwaitItemIsNotReceived() { | |
try { | |
awaitItem() | |
Assert.fail("Expected no event was received in time") | |
} catch (e: TimeoutCancellationException) { | |
// SharedFlowに値が流れてこないと[TimeoutCancellationException]が発生するため、それを正とする | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment