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.

  1. you can use expectations async tests: asynchronous testing xcode 6
  2. you can use ohhttpstubs avoid unneeded network traffic , server load: usage examples

Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -