Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created April 22, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriswebb09/526c511b7faaa6c71f0bc32b8f894aa8 to your computer and use it in GitHub Desktop.
Save chriswebb09/526c511b7faaa6c71f0bc32b8f894aa8 to your computer and use it in GitHub Desktop.
Testing code
func testDataStore() {
let dataSource = iTrackDataStore(searchTerm: "new")
let expect = expectation(description: "Data store calls APIClient to access server data and returns iTrack data array.")
dataSource.searchForTracks { tracks, error in
XCTAssert(tracks?.count == 49)
expect.fulfill()
}
waitForExpectations(timeout: 4) { error in
if let error = error {
XCTFail("waitForExpectationsWithTimeout errored: \(error)")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment