Unit testing a collection
You can test a collection individually, before testing it in the context of the application that you are developing.
You specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results. Additionally, you can convert the test run into a Pega unit test case.- In the navigation pane of Dev Studio, click , and then select the collection that you want to test.
- Click .
- In the Run context pane, select the thread, test page, and data
transform you want to use for the test.
- In the Thread list, select the thread in which you want to run the rule.
- In the Page list, select whether to copy parameter values
from an existing page or to create an empty page:
To use parameter values from an existing clipboard page in the selected thread, click Copy existing page, and then select the page you want to copy.
To start from a page containing no parameter values, click Empty test page.
- Optional: To apply a data transform, select the Apply data transform
check box, and then select the transform to apply.
- Optional: To change the values that are passed to the rule, provide the new values on the main test page.
- Click Run to run the test.
- To convert the test run into a Pega unit test case, click Convert to test, and then configure the test case. For more information, see Creating unit test cases for rules.
- Optional: If the rule has errors, then click Trace to debug it using the Tracer tool. For more information, see Application debugging by using the Tracer tool.
- Click Clipboard to open the Clipboard and examine the pages that are generated by the unit test. For more information, see Clipboard pages created by the Run Rule feature.
Previous topic Unit testing a map value Next topic Unit testing a declare expression