This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5443751-testing-with-mockk/lessons/9
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5443751-testing-with-mockk/lessons/9
Alex, I was adding pagin3 to my proyect, but for me is not easy to mock my use case that returns me a Page(…).liveData
class FetchPaginatedDataUseCase(private val remote: DataApiRemote) {
fun run(bntpParams: PricingParams) = Pager(
config = PagingConfig(
enablePlaceholders = false,
pageSize = DEFAULT_PAGE_SIZE,
prefetchDistance = ITEMS_BEFORE_END_TO_TRIGGER_ANOTHER_REQUEST
),
pagingSourceFactory = { RepositoryWithPaging(bntpParams, remote) }
).liveData
}