Thanks for your work! Could you please add test coverage for common test scenarios?
I am moving from old paradigm (rxjava, model-view-presenter, etc) to a new one (data binding, view model, coroutines, etc) and looking for a right way to cover it with tests. In particular case I have screen with PagingDataAdapter and need to verify is there a call of showError() when API is set to return negative response from server.
In the past I would provide a view interface which will handle all operation on view layer within activity|fragment and mock it in the tests and call verify(view).invoke(showError()). Nowadays it looks like it is not a preferred way, PagingDataAdapter has addLoadStateListener() where, in theory, we also could provide mocks. I am working on this right now, but would like to see how Google team sees the right way to write tests for this and similar common cases.
p.s.
I have read this your legal notice , as I haven't provided any code yet I leave this paperwork for later.
Hello,
Thanks for your work! Could you please add test coverage for common test scenarios?
I am moving from old paradigm (rxjava, model-view-presenter, etc) to a new one (data binding, view model, coroutines, etc) and looking for a right way to cover it with tests. In particular case I have screen with
PagingDataAdapter
and need to verify is there a call ofshowError()
when API is set to return negative response from server.In the past I would provide a
view interface
which will handle all operation on view layer withinactivity|fragment
and mock it in the tests and callverify(view).invoke(showError())
. Nowadays it looks like it is not a preferred way,PagingDataAdapter
hasaddLoadStateListener()
where, in theory, we also could provide mocks. I am working on this right now, but would like to see how Google team sees the right way to write tests for this and similar common cases.p.s. I have read this your legal notice , as I haven't provided any code yet I leave this paperwork for later.