You can test a map value individually, before testing it in the context of the
application that you are developing. Additionally, you can convert the test run to a Pega unit
test case.
Testing a map value involves specifying a test page for the rule to
use, providing sample values for required parameters, running the rule, and then examining the
test results.
-
In the navigation panel of Dev Studio, click , and then click the map value that you want to test.
-
Click .
-
In the Test Page pane, select the context and test page to use
for the test:
-
In the Data Context list, click the thread in which you want
to run the rule. If a test page exists for the thread, then it is listed and is used
for creating the test page.
-
To discard all previous test results and start from a blank test page, click
Reset Page.
-
To apply a data transform to the values on the test page, click the data transform
link, and then select the data transform you want to use.
-
Enter sample values to use for required parameters in the
Results pane and then click Run
Again.
Result: The value that you enter and the result that is returned are the values that are
used for the default decision result assertion that is generated when you convert this
test to a test case.
- Optional:
To view the pages that are generated by the unit test, click Show
Clipboard. For more information, see Clipboard pages created by the Run Rule feature.
-
To convert the test into a Pega unit test case, click Convert to
Test. For more information, see Configuring Pega unit test cases.
- Optional:
To view the row that produced the test result, click a Result Decision
Paths link.