paulex
01/27/2020, 12:46 AMfun foo(callback){
GlobalScope.launch {
val x = async {//}.await()
callback(x)
}
}
//Test
@Test
`test that we can test`(){
//i should be able to test that callback is called with value x
}
E.Kisaragi
01/27/2020, 2:58 AMErik
01/27/2020, 8:44 AMpaulex
01/27/2020, 10:02 AMval callback = mockk<StreamObserver<Wallet>>()
val slot = slot<Wallet>()
every { callback.onNext(capture(slot)) } just Runs
every { callback.onCompleted() } just Runs
paulex
01/27/2020, 10:03 AMfoo
function that the code within launch block runs..
However it seems that my test function runs to completion before the callback..paulex
01/27/2020, 10:55 AMpaulex
01/27/2020, 10:55 AM