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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -