Pablo
05/04/2022, 8:41 AMFlow<T>
as a parameter and then inside has a collect { }
?
Example
fun doStuff(flow: Flow<String>) {
scope.launch {
flow.collect {
if(!it in myList) {
dataSource.add(it)
}
}
}
}
How would I have this verify that dataSource.add(it)
? Considering this myList
is something I can mock tooJavier
05/04/2022, 8:43 AMPablo
05/04/2022, 8:44 AMrunBlocking {
myMethod.doStuff(flowOf("hello"))
}
Pablo
05/04/2022, 8:44 AMJavier
05/04/2022, 8:45 AMPablo
05/04/2022, 8:46 AMJavier
05/04/2022, 8:47 AMPablo
05/04/2022, 8:48 AMJavier
05/04/2022, 8:49 AMJavier
05/04/2022, 8:49 AM