Unit testing a section
After you create a section rule, you can run the rule to test it in the context of the application you are developing. Specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results.
- In the navigation pane of Dev Studio, click , and then select the harness you want to test.
- Click Actions > Run. The Run Rule window opens.
- In the Test Page pane, select the context and test page to use for the
test.
- In the Data Context list, select the thread in which you want to run the rule. If a test page exists for the thread, then it is listed and can be used for creating the test page.
- Select the test page to use for the test:
- Select Empty test page to start from a page containing no parameter values.
- If a clipboard page exists, then you can select Copy existing page to copy values from a thread of an existing clipboard page to the main test page.
- Select Create or reset test page to create a new test page or reset the values of an existing test page.
- To apply a data transform to values on the test page, click the link in the Apply field, and then select a data transform.
- In the lower section of the Run Rule window, enter the test data and click
Execute. The system runs the harness and displays the results.
- To convert the test into a Pega unit test case, click Convert to Test. For more information, see Viewing test coverage reports.
Previous topic Unit testing a harness Next topic Unit testing data model rules