iOS单元测试和UI测试全面解析(17)
发表于:2017-03-31来源:51CTO作者:朱先忠点击数:
标签:单元测试iOS
varstatusCode: Int ? varresponseError:Error? // when letdataTask=sessionUnderTest.dataTask( with :url!){data,response,error in statusCode=(response as ?HTTPURLResponse)?.statusCode responseError=error
var statusCode: Int?
var responseError: Error?
// when
let dataTask = sessionUnderTest.dataTask(with: url!) { data, response, error in
statusCode = (response as? HTTPURLResponse)?.statusCode
responseError = error
// 2
原文转自:http://mobile.51cto.com/iphone-535758.htm