ios - Unit test for AFNetworking Post request -
i trying write unit test project use afnetworking in.i use following operation request:
- (void)testregisterrequest{ afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; [manager post:url parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { xctassert(result,"register failed!"); } failure:^(afhttprequestoperation *operation, nserror *error) { //failure }
as asynchronous never test xctassert line. searched lot couldn't manage find tutorial or example these test cases.please me tutorial link or hint. in advance
there couple of things here.
- you can use expectations async tests: asynchronous testing xcode 6
- you can use ohhttpstubs avoid unneeded network traffic , server load: usage examples
Comments
Post a Comment