[問題] unit test closure

作者: valda (valda)   2015-07-02 15:07:39
有人試過單元測試closure function嗎?
func testExample() {
// This is an example of a functional test case.
ParseModel.sharedInstance.getAllCategory({ () -> () in
XCTFail("fail")
}) { (error) -> Void in
println("\(error)")
XCTFail("fail")
}
}
做單元測試,想測試closure base的function,
怎樣都不會進到onSuccess或onFail兩個block中,
這類的function沒辦法unit test嗎?
感謝
作者: shinrenpan (iOS5)   2015-07-02 15:27:00
關鍵字搜尋 `xcode unit test asynchronous`

Links booklink

Contact Us: admin [ a t ] ucptt.com