https://kotlinlang.org logo
Title
a

aaverin

08/23/2018, 3:31 PM
How I test it now:
@Test
    fun `ok result of registration results in success`() = blocking {
        val result = classToTest.execute(appConfig).await()
        mockRegisterResponseSuccess(ApiResponseStatus.OK)
        mockInitAppPurchasesSuccess()
        result.should.be.equal(trackingId)
    }
m

Martin Devillers

08/23/2018, 3:32 PM
Try putting the
Deferred
into a local variable and waiting until you’ve fired the mocks before calling
await
on it
Otherwise you’re never firing the mocks because you’re stuck on the first line
g

gildor

08/23/2018, 3:34 PM
+1 to Martin, this is exactly what I meant