Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkServiceMock where responses can be defined before they are consumed #103

Open
ch-one opened this issue Nov 25, 2020 · 0 comments
Open

Comments

@ch-one
Copy link
Contributor

ch-one commented Nov 25, 2020

In some situations it would be helpful to have a NetworkServiceMock where mocked responses can be defined before they are consumed.

Having an additional mock would bring the following benefits:

  • Separation of mock setup and test code
  • Response definition can be located in one place (in the beginning of the test method or in setUp method) and is not scattered
  • Cases where it is not clear, when the network call will happen are no longer a problem
  • Freedom of choice: Current NetworkServiceMock is still available

In addition the possibility to define a timing behaviour may be interesting. Something like:

  • Immediately
  • Delayed (by amount of time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant