How to do proper Unit Testing with Chopper #539
Unanswered
ratzrattillo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am having issues understanding how to do proper Unit testing with Chopper.
The code i am talking about is attached as a zip archive to this discussion, so reproduction is easy!
My current assumptions are
This is how the API Service is defined:
The class DeviceCapabilities is a freezed class:
Currently i make use of a custom MockClient to return the JSON responses. The responses are loaded from assets within the project's assets directory:
The test is currently flawed/incomplete and implemented like this:
My questions are:
I am looking forward to your responses and maybe some code, to show the most elegant and idomatic way to Unit Test responses returned from a ChopperService with (or without) Mockito.
I am aware of https://hadrien-lejard.gitbook.io/chopper/faq#mock-chopperclient-for-testing but that does not actually answer my questions.
If further details are required please let me know!
Beta Was this translation helpful? Give feedback.
All reactions