Created
August 8, 2015 00:51
-
-
Save pangers/891975f4a8b988bd5c88 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 AsynchronousTesting: XCTestCase { | |
var clientManager: APIManager! | |
func setUp() { | |
clientManager = APIManager() | |
} | |
func testLongOperationCorrectly() { | |
var users: [Users] = [] | |
let fetchExpectation = expectationWithDescription("Fetching list of users") | |
clientManager.getListOfUsers { incomingUsers, error in | |
if error == nil { | |
users = incomingUsers | |
XCTAssert(users.count > 0, "Users returned should always be greater than zero") | |
fetchExpectation.fulfill() | |
} | |
} | |
waitForExpectationsWithTimeout(5, handler: nil) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment