iOS单元测试和UI测试全面解析(6)

发表于:2017-03-31来源:51CTO作者:朱先忠点击数: 标签:单元测试iOS
//XCTAssert to testmodel functestScoreIsComputed(){ //1.given letguess=gameUnderTest.targetValue+5 //2. when _=gameUnderTest. check (guess:guess) //3. then
// XCTAssert to test model 
  • func testScoreIsComputed() { 
  •   // 1. given 
  •   let guess = gameUnderTest.targetValue + 5 
  •   
  •   // 2. when 
  •   _ = gameUnderTest.check(guess: guess) 
  •   
  •   // 3. then

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