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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -