iOS单元测试和UI测试全面解析(22)
发表于:2017-03-31来源:51CTO作者:朱先忠点击数:
标签:单元测试iOS
lettestBundle=Bundle( for :type( of :self)) letpath=testBundle.path(forResource: abbaData ,ofType: json ) letdata=try?Data(contentsOf:URL(fileURLWithPath:path!),options:.alwaysMapped) leturl=URL(strin
-
let testBundle = Bundle(for: type(of: self))
-
let path = testBundle.path(forResource: "abbaData", ofType: "json")
-
let data = try? Data(contentsOf: URL(fileURLWithPath: path!), options: .alwaysMapped)
-
-
let url = URL(string: "https://itunes.apple.com/search?media=music&entity=song&term=abba")
-
let urlResponse = HTTPURLResponse(url: url!, statusCode: 200, httpVersion: nil, headerFields: nil)
-
原文转自:http://mobile.51cto.com/iphone-535758.htm