2016-11-19 105 views
0

我有以下测试文件。奇怪的是,当我点击CMD + U时,测试运行完美,但是没有文件是测试文件的迹象(即代码左侧没有菱形)。Xcode无法识别单元测试

enter image description here

import XCTest 
@testable import Saba_Center 

class SabaCenterTests: XCTestCase { 

    var residentAlimVC: ResidentAlimViewController! 

    override func setUp() { 
     super.setUp() 
     // Put setup code here. This method is called before the invocation of each test method in the class. 

     let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) 
     vc = storyboard.instantiateInitialViewController() as! ResidentAlimViewController 
     _ = vc.view 

    } 

    override func tearDown() { 
     // Put teardown code here. This method is called after the invocation of each test method in the class. 
     super.tearDown() 
    } 

} 

回答

0

您没有任何测试,以测试。你需要做一个像它支撑你的测试。

例如为:

func testExample() { 
    // Put your test code here 
} 
+0

我也仍然没有工作......这里的日志消息:捆绑“SabaCenterTests”无法加载,因为它的可执行文件无法找到 –