|
@@ -80,7 +80,7 @@
|
|
|
XCTAssertTrue(error.code == NSURLErrorBadURL);
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
XCTAssertNil(downloadReceipt, @"downloadReceipt should be nil");
|
|
|
}
|
|
|
|
|
@@ -99,7 +99,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertNotNil(urlResponse, @"HTTPURLResponse should not be nil");
|
|
|
XCTAssertNotNil(responseImage, @"Response image should not be nil");
|
|
@@ -132,7 +132,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertNotNil(urlResponse1, @"HTTPURLResponse should not be nil");
|
|
|
XCTAssertNotNil(responseImage1, @"Respone image should not be nil");
|
|
@@ -168,7 +168,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertEqual(urlResponse1, urlResponse2, @"responses should be equal");
|
|
|
XCTAssertEqual(responseImage2, responseImage2, @"responses should be equal");
|
|
@@ -190,7 +190,7 @@
|
|
|
[expectation fulfill];
|
|
|
}
|
|
|
failure:nil];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
XCTAssertNotNil(urlResponse);
|
|
|
XCTAssertNotNil(responseImage);
|
|
|
|
|
@@ -211,7 +211,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
|
|
__block NSHTTPURLResponse *urlResponse2 = nil;
|
|
@@ -226,7 +226,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertNotNil(urlResponse1);
|
|
|
XCTAssertNotNil(responseImage1);
|
|
@@ -244,7 +244,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
|
|
|
|
@@ -256,7 +256,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertNotNil(receipt1);
|
|
|
XCTAssertNil(receipt2);
|
|
@@ -277,7 +277,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTestExpectation *expectation2 = [self expectationWithDescription:@"image 2 download should succeed"];
|
|
|
NSMutableURLRequest *alteredRequest = [self.pngRequest mutableCopy];
|
|
@@ -295,7 +295,7 @@
|
|
|
}
|
|
|
failure:nil];
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertNotNil(receipt1);
|
|
|
XCTAssertNotNil(receipt2);
|
|
@@ -324,7 +324,7 @@
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
[self.downloader cancelTaskForImageDownloadReceipt:receipt];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertTrue(responseError.code == NSURLErrorCancelled);
|
|
|
XCTAssertTrue([responseError.domain isEqualToString:NSURLErrorDomain]);
|
|
@@ -355,7 +355,7 @@
|
|
|
[expectation2 fulfill];
|
|
|
}];
|
|
|
[self.downloader cancelTaskForImageDownloadReceipt:receipt];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
|
|
|
XCTAssertTrue(responseError.code == NSURLErrorCancelled);
|
|
|
XCTAssertTrue([responseError.domain isEqualToString:NSURLErrorDomain]);
|
|
@@ -398,7 +398,7 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
}
|
|
|
|
|
|
#pragma mark - Threading
|
|
@@ -412,7 +412,7 @@
|
|
|
[expectation fulfill];
|
|
|
}
|
|
|
failure:nil];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
XCTAssertTrue(successIsOnMainThread);
|
|
|
}
|
|
|
|
|
@@ -427,7 +427,7 @@
|
|
|
failureIsOnMainThread = [[NSThread currentThread] isMainThread];
|
|
|
[expectation fulfill];
|
|
|
}];
|
|
|
- [self waitForExpectationsWithCommonTimeoutUsingHandler:nil];
|
|
|
+ [self waitForExpectationsWithCommonTimeout];
|
|
|
XCTAssertTrue(failureIsOnMainThread);
|
|
|
}
|
|
|
|