Generating Code in Unit Tests
You can use the Code Generation feature to assist you with test cases.
For OCUnit, XCTest, or Google Test, it can help you quickly create SetUp
, TearDown
, or Test
methods:
For Kiwi, use it to create it
, context
, beforeEach
, afterEach
, and specify
blocks:
You can also use a Kiwi Live Template to generate Kiwi Spec.
For Google Test, AppCode offers you a variety of TEST
macros:
You can generate a TEST()
macro and after you specify a suite name, AppCode will change this macro to the correct one automatically.
To create code constructs using Generate menu
- Open the file where you are going to generate code and place the caret at the corresponding position.
- On the main menu, choose . Alternatively, right-click the editor and choose Generate on the context menu, or press ⌘N.
- In the Generate menu that is displayed in the editor, select the desired construct.
- Depending on the selected item, AppCode either inserts the construct immediately or shows a dialog for additional input.
See Also
Last modified: 20 July 2016