You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: