简体   繁体   English

Xcode无法识别单元测试

[英]Xcode not recognizing Unit Test

I have the following test file. 我有以下测试文件。 The strange thing is that when I hit CMD+U the test runs perfectly however there are no indications of the file being a test file (ie no diamonds on the left side of the code). 奇怪的是,当我按下CMD + U时,测试可以完美运行,但是没有迹象表明该文件是测试文件(即,代码左侧没有菱形)。

在此处输入图片说明

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()
    }

}

You don't have any tests to test. 您没有要测试的测试。 You need to make a test like the one it scaffolds for you. 您需要进行类似脚手架的测试。

eg: 例如:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM