Tried to check out how to use XCTest framework for an application which is using REST web services. But did not find any good and complete example tutorial.
I have only some basic idea of XCTest but confused to use XCTest with REST application.
Can anybody give me some examples of how to use this. I just need the idea and direction and then I can go.
Note: If the application is a basic application, I know but my confusion is only for REST based iOS application testing.
I am using
XCTestExpectation
for testing client-server communication that is based on REST protocol.Here is high level example:
This test cover such expectation cases:
1. Server has to return response in 30 seconds or less;
2. Server has to return valid JSON object with valid response code;
3. JSON object has to have correct structure for mapping to User object.