Last active
March 1, 2018 10:31
-
-
Save jinahadam/c7bff47798c7e81ad3a45afca6f07664 to your computer and use it in GitHub Desktop.
#swift #testing
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
func testInfoLoading() { | |
let url = "https://raw.githubusercontent.com/FahimF/Test/master/DogYears-Info.rtf" | |
HTTPClient.shared.get(url: url) { | |
(data, error) in | |
self.resData = data | |
} | |
let pred = NSPredicate(format: "resData != nil") | |
let exp = expectation(for: pred, evaluatedWith: self, handler: nil) | |
let res = XCTWaiter.wait(for: [exp], timeout: 5.0) | |
if res == XCTWaiter.Result.completed { | |
XCTAssertNotNil(resData, "No data recived from the server for InfoView content") | |
} else { | |
XCTAssert(false, "The call to get the URL ran into some other error") | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment