• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • iOS單元測試和UI測試全面解析(23)

    發表于:2017-03-31來源:51CTO作者:朱先忠點擊數: 標簽:單元測試iOS
    letsessionMock=URLSessionMock(data:data,response:urlResponse,error:nil) At the end of setup(),injectthefakesession into theapp as aproperty of theSUT: controllerUnderTest.defaultSession=sessionMock 【注
      
  • let sessionMock = URLSessionMock(data: data, response: urlResponse, error: nil) 
  • At the end of setup(), inject the fake session into the app as a property of the SUT: 
  •  
  • controllerUnderTest.defaultSession = sessionMock 
  • 【注意】您將直接在您的測試中使用偽造的會話,但是這將向你展示如何注入這種偽造的會話;這樣一來,你進一步的測試可以調用使用視圖控制器defaultSession屬性的SUT方法。

    現在,您可以編寫測試來檢查是否調用updateSearchResults(_:)方法能夠解析偽造的數據。為此,請把TestExample()方法替換為以下內容︰

    
    
    1. 原文轉自:http://mobile.51cto.com/iphone-535758.htm

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>