How to emit a value to SharedFlow inside SUT (System Under Test) from unit test?
I would like to emit a value to a SharedFlow which is inside SUT and check corresponding behavior based on what being collected inside SUT.
I have following classes:
class OddNumber() {
fun odd(){
}
}
class EvenNumber() {
fun even() {
}
}
object Repository {
private var _intSharedFlow = MutableSharedFlow()
var intSharedFlow = _intSharedFlow.asSharedFlow()
}
My SUT is MyViewModel class which collects and reacts to a shared flow emissions.
class MyViewModel {...