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
I see the Request implementations are easily unit-testable which is nice. But what is the preferred approach to testing for clients of the Session API? It's declared as a class rather than a protocol so it's not simply a matter of substituting a fake a test time. I don't see a "MockSessionAdapter" in the test tree, but is that the appropriate hook point?
The text was updated successfully, but these errors were encountered:
Good question.
I guess subclassing the Session class and overriding the functions isn't really ideal (or creating a completely new "MockSession" class). I would welcome a better approach to test our code with APIKit @ishkawa.
Yes, SessionAdapter is an appropriate hook point for mocking. I always create mock adapter like this. It would be great if APIKit has a flexible implementation of MockSessionAdapter for general purpose.
I see the
Request
implementations are easily unit-testable which is nice. But what is the preferred approach to testing for clients of theSession
API? It's declared as a class rather than a protocol so it's not simply a matter of substituting a fake a test time. I don't see a "MockSessionAdapter
" in the test tree, but is that the appropriate hook point?The text was updated successfully, but these errors were encountered: