UI Testing - Mocking Network Data
- Create a
Configurationobject that provides an instance ofNSURLSession. When running under UI Testing return a seeded one, otherwise use the default one. - Grab a
NSURLSessionfrom the configuration in your HTTP client. - Subclass
NSURLSessionto use seeded data when appropriate. - Seed your response JSON in your UI Tests.