iOS单元测试和UI测试全面解析(11)
发表于:2017-03-31来源:51CTO作者:朱先忠点击数:
标签:单元测试iOS
varsessionUnderTest:URLSession! overridefuncsetUp(){ super.setUp() sessionUnderTest=URLSession(configuration:URLSessionConfiguration. default ) } overridefunctearDown(){ sessionUnderTest=nil super.tea
var sessionUnderTest: URLSession!
override func setUp() {
super.setUp()
sessionUnderTest = URLSession(configuration: URLSessionConfiguration.default)
}
override func tearDown() {
sessionUnderTest = nil
super.tearDown()
}
接下来,使用TestExample()函数来替换您的异步测试︰
原文转自:http://mobile.51cto.com/iphone-535758.htm