Created
January 13, 2020 19:51
-
-
Save jeksys/dad41eaa33395b0a9c9d7dc009ae8e0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImageScalerTests: XCTestCase { | |
func testScalingProducesSameAmountOfImages() { | |
let scaler = ImageScaler() | |
let originalImages = loadImages() | |
// Create an expectation | |
let expectation = self.expectation(description: "Scaling") | |
var scaledImages: [UIImage]? | |
scaler.scale(originalImages) { | |
scaledImages = $0 | |
// Fullfil the expectation to let the test runner | |
// know that it's OK to proceed | |
expectation.fulfill() | |
} | |
// Wait for the expectation to be fullfilled, or time out | |
// after 5 seconds. This is where the test runner will pause. | |
waitForExpectations(timeout: 5, handler: nil) | |
XCTAssertEqual(scaledImages?.count, originalImages.count) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment