iOS單元測試和UI測試全面解析(12)
發表于:2017-03-31來源:51CTO作者:朱先忠點擊數:
標簽:單元測試iOS
//異步測試時:成功測試很快,失敗測試卻比較慢 functestValidCallToiTunesGetsHTTPStatusCode200(){ //given leturl=URL(string: https://itunes.apple.com/search?media=musicentity=songter
-
//異步測試時:成功測試很快,失敗測試卻比較慢
-
func testValidCallToiTunesGetsHTTPStatusCode200() {
-
// given
-
let url = URL(string: "https://itunes.apple.com/search?media=music&entity=song&term=abba")
-
// 1
-
let promise = expectation(description: "Status code: 200")
-
-
// when
-
原文轉自:http://mobile.51cto.com/iphone-535758.htm