Posts

Post not yet marked as solved
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!