func testExample() {
let expectation = expectationWithDescription("GET \(URL)")
let webAPI: WebAPI()
// 非同步
webAPI.invoke() { (model) -> Void in
expectation.fulfill()
}
waitForExpectationsWithTimeout(task.originalRequest!.timeoutInterval) { error in
if let error = error {
print("Error: \(error.localizedDescription)")
}
}
}
參考資料:
http://nshipster.com/xctestcase/
全站熱搜
留言列表