Stylianos Gakis
12/17/2021, 2:54 PMprivate val mockedApolloClient = mockk<ApolloClient>().apply {
val apolloClient = this
coEvery { apolloClient.query(MyCustomQuery()/* or even omit this if possible?*/) } coAnswers {
MyObject()
}
}
private val useCase = MyUseCase(mockedApolloClient)
@Test
fun someTest() {
assert(useCase(input) == SomeResult)
}
I tried looking into the documentation and I didn’t find anything out unfortunately. Note that we’re still on 2.x.x but if a better solution exists for 3.0.0 I’d be happy to hear that as we’ll migrate to it soon anyway.mbonnin
12/17/2021, 3:07 PMStylianos Gakis
12/17/2021, 3:48 PMmbonnin
12/17/2021, 3:50 PMStylianos Gakis
12/17/2021, 3:55 PM