看板 MacDev 關於我們 聯絡資訊
有人試過單元測試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嗎? 感謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.72.69.111 ※ 文章網址: https://www.ptt.cc/bbs/MacDev/M.1435820861.A.6A8.html
shinrenpan: 關鍵字搜尋 `xcode unit test asynchronous` 07/02 15:27