Hi, does anyone know if there is any library to test Paging 3? The only library I've found is "androidx.paging:paging-common" but there is literally 0 information, guide or documentation for it, does anyone know if they finally implemented any testing library for Paging 3?
d
Dustin Lam
02/10/2021, 5:11 PM
What are you interested in asserting more precisely?
b
buszi0809
02/10/2021, 5:17 PM
Like for example i have complex RemoteMediator class that should be tested, but i have 0 access to values, and the only thing that is possible is to verify that some methods from services were invoked, but it's hard to do because every single thingy like PagingState needs to be mocked to even run it, it's like the worst library to be tested 😅
d
Dustin Lam
02/10/2021, 6:09 PM
well, by values do you mean items presented by adapter? I would probably try to test the adapter bits independently from RemoteMediator because RemoteMediator is more like a callback and doesn't actually directly contribute to what adapter will show
Dustin Lam
02/10/2021, 6:10 PM
in terms of mocking / faking, you should probably be writing mocks for the things RemoteMediator depends on and not the actual args you're passing into it
Dustin Lam
02/10/2021, 6:11 PM
If you want to share your test though, I can try to help you figure out how to achieve what you're trying to do