The current implementation I have is an AFHTTPClient
subclass and accompanying manager class that handles the connection with an API
. As the app will be used in places where network connectivity can't be guaranteed, I'm wanting to write some unit tests around the code which handles a change in the network reachability.
I've implemented a setReachabilityStatusChangeBlock
and want to make sure that this gets called and behaves in the correct way.
Is anyone familiar with simulating a change in network reachability to be used in unit testing? I'm currently using Kiwi for unit testing and OHHTTPStubs
for simulating the data returned from the webservice
.
What is the usual way of testing these situations?