Creating a test case from the project explorer

You can create a test case from the project by simply selecting a source file or a function. Each test case focuses on a particular function.

Procedure

To create a test case from the project explorer:
  1. In the project explorer, right-click the project, source file, or a function, and click New > Test Case.
    If you select a function, skip to step 3.
    The Create Test Case wizard opens.
  2. On the Select Test Assets page, select the function or variable that you want to test and click Next.
    You can choose to only display Only functions, Only variables, or you can filter the list by typing characters in Filter. Click Clear to clear the filter list.
  3. On the Test Documentation page, you can edit the description of the test, and click Next.
    The Published description contains information that you want to display in the test report. Use the Internal notes to add personal notes and comments that can be viewed and edited in the test editor.
  4. On the Test Case Location page, select a folder and a type a file name for the test case and click Finish.
  5. Choose whether you want to create a new test harness or use an existing one.
    A test harness contains one or several test cases and is necessary to run the test.
    • If you want to add the test case to an existing test harness, in the click No. You must edit the test harness to add the new test case.
    • If not, click Yes and create a test harness with the Create Test Harness wizard.

Results

The test case and test harness are generated in the project explorer and the test case editor opens. Editing test cases for information about the test case editor.