簡體   English   中英

GHUnit和AFNetWorking之間的兼容性

[英]compatibility between GHUnit and AFNetWorking

嗨,我嘗試使用GHUnit創建單元測試,但我有一個例外,我認為這是AFNetWorking與GHUnit之間的兼容性問題
異常'GHTestFailureException',原因:'失敗' *首次拋出調用堆棧:(0x1de4012 0x163fe7e 0x1e6cfb1 0x2a4c1 0x2f20 0x137a4 0x191553f 0x1927014 0x19177d5 0x1d8aaf5 0x1d89f44 0x1d5ce 0e1x95e 0b

  NSURL *url = [NSURL @"https://www.myWebsite.com"];
        NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0];

        AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:theRequest];


        [operation setAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {
            NSURLCredential *newCredential = [NSURLCredential credentialWithUser:@"login" password:@"password" persistence:NSURLCredentialPersistenceForSession];
            [challenge.sender useCredential:newCredential forAuthenticationChallenge:challenge];
        }];

            NSLog(@"Response from %@",response);

        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

            GHFail(@"failed"); }];


        [operation start];
        [operation waitUntilFinished];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM