Post not yet marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as unsolved with 2 replies, 0 views
So global variable it is (it's good to know that a new protocol instance is created for each request, that wasn't obvious). The problem with mocking on top of the URLProtocol code is you're even farther from testing your code's behavior in the system. At least with URLProtocol mocking I'm testing down to that layer of the system. This also works then for Previews and unit tests as well as the UI tests. Mocks won't help with those cases. But thanks for taking the time to answer!