|
|
@@ -148,7 +148,6 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
}) { (image, error, cacheType, imageURL) -> () in
|
|
|
XCTAssertEqual(error?.code, KingfisherError.downloadCancelledBeforeStarting.rawValue, "The error should be downloadCancelledBeforeStarting")
|
|
|
XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
expectation.fulfill()
|
|
|
}
|
|
|
|
|
|
@@ -173,7 +172,6 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
XCTAssertNotNil(error)
|
|
|
XCTAssertEqual(error?.code, NSURLErrorCancelled)
|
|
|
XCTAssert(progressBlockIsCalled == false, "ProgressBlock should not be called since it is canceled.")
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
expectation.fulfill()
|
|
|
}
|
|
|
|
|
|
@@ -222,11 +220,7 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
task1.cancel()
|
|
|
delay(0.1) { _ = stub!.go() }
|
|
|
|
|
|
- group.notify(queue: .main) {
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
- expectation.fulfill()
|
|
|
- }
|
|
|
-
|
|
|
+ group.notify(queue: .main, execute: expectation.fulfill)
|
|
|
waitForExpectations(timeout: 5, handler: nil)
|
|
|
}
|
|
|
|
|
|
@@ -268,11 +262,7 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
_ = stub!.go()
|
|
|
}
|
|
|
|
|
|
- group.notify(queue: .main) {
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
- expectation.fulfill()
|
|
|
- }
|
|
|
-
|
|
|
+ group.notify(queue: .main, execute: expectation.fulfill)
|
|
|
waitForExpectations(timeout: 5, handler: nil)
|
|
|
}
|
|
|
|
|
|
@@ -320,11 +310,7 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
_ = stub!.go()
|
|
|
}
|
|
|
|
|
|
- group.notify(queue: .main) {
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
- expectation.fulfill()
|
|
|
- }
|
|
|
-
|
|
|
+ group.notify(queue: .main, execute: expectation.fulfill)
|
|
|
waitForExpectations(timeout: 5, handler: nil)
|
|
|
}
|
|
|
|
|
|
@@ -485,11 +471,7 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
group.leave()
|
|
|
}
|
|
|
|
|
|
- group.notify(queue: .main) {
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
- expectation.fulfill()
|
|
|
- }
|
|
|
-
|
|
|
+ group.notify(queue: .main, execute: expectation.fulfill)
|
|
|
waitForExpectations(timeout: 5, handler: nil)
|
|
|
}
|
|
|
|
|
|
@@ -604,11 +586,7 @@ class ImageViewExtensionTests: XCTestCase {
|
|
|
group.leave()
|
|
|
}
|
|
|
|
|
|
- group.notify(queue: .main) {
|
|
|
-// delay(0.1, block: expectation.fulfill)
|
|
|
- expectation.fulfill()
|
|
|
- }
|
|
|
-
|
|
|
+ group.notify(queue: .main, execute: expectation.fulfill)
|
|
|
waitForExpectations(timeout: 1, handler: nil)
|
|
|
}
|
|
|
}
|