https://kotlinlang.org logo
#coroutines
Title
# coroutines
i

Ivan Pavlov

12/21/2020, 4:17 PM
Hi guys, I have something like
Copy code
private val eventFlow = MutableSharedFlow<BotStatusChangeEvent>()

override val events: Flow<Event> = eventFlow

override fun sendEvent(event: Event) {
    coroutineScope.launch {
        eventFlow.emit(event)
    }
}
What is the correct way to test that if I do
Copy code
sendEvent(Event(1))
sendEvent(Event(2))
sendEvent(Event(3))
I receive all events in
events
flow?
3 Views