Adding Unit Tests to an already existing project?

前端 未结 7 1415
不知归路
不知归路 2020-12-02 16:45

When you create an XCode 4 project, it asks you if you want to include unit testing. But how do you add it to a project that\'s been created without them?

I started

7条回答
  •  感动是毒
    2020-12-02 17:01

    One more variant using Test navigator

    Xcode version 10.2.1

    1. Open Test navigator(⌘ Command + 6)
    2. + at the bottom
    3. New Unit Test Target...
    4. Choose options

    Do not forget add next import to test internal[About] elements

    • #import "myClass.h" for Objective-C
    • @testable import module_name for Swift

提交回复
热议问题