Hi @Obelix. Thanks for the response, and apologies for the hazy question. Admittedly I wrote the above late at night - I'll try clarify with an example:
At present, if I want to mock out network functionality, in each specific test I'll do something like:
objectBeingTested.networkDependency = MockNetworkHandler()
I have to include that line in every test (or at least, in the setupWithErrors() for every test) I want to run.
Given I'm never going to want to run tests on the live network, I'm looking for a way to ensure that, for all tests in my test suite, that MockNetworkHandler is automatically set. I'm not sure what the convention is for doing that.
I'm guessing extending the networking class within the test target might be an option, but just adding a file that extends the network class doesn't seem to get picked up in the test suite.
As for adding network code to the actual (non-test) code: I'm happy to do that, but my experience from other languages makes the idea of putting test logic into non-test code a little nerve-inducing. Is that considered a kosher practice in Swift?