[問題] unit test closure

看板MacDev作者 (valda)時間9年前 (2015/07/02 15:07), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
有人試過單元測試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

07/02 15:27, , 1F
關鍵字搜尋 `xcode unit test asynchronous`
07/02 15:27, 1F
文章代碼(AID): #1LbECzQe (MacDev)