You are here: Reference > Rule types > Strategy rules > Unit testing a strategy

Unit testing a strategy

You can use the Run Rule feature to test a strategy individually before testing it in the context of the application that you are developing. Optionally, you can convert the run to a PegaUnit test case.

Note: it is recommended that you create a test case by running a single test, which offers more robust testing capabilities. For more information, see Configuring a single case run.

  1. Open a strategy by clicking Records > Decision > Strategy and selecting the strategy that you want to open.
  1. Select Actions > Run.

  2. Select the thread in which you want to run the rule from the Thread list in the Run context pane.

  3. Specify if you want to set up initial values on the clipboard.

    Note: The system always runs the rule instance on the RunRecordPrimaryPage, regardless of the page that you select from this list. If you convert this rule run to a test case, and the RunRecordPrimaryPage requires initial values, you should set the clipboard up to populate the page with initial values. See Setting up your test environment

  1. Click Run.

  2. From the View results from list, either select All to view test results from all components or select a component to view test results returned by that component.

  3. Optional: To convert the test to a test case, click Convert to test. A new Create Test Case tab is displayed in the main Designer Studio window. See Test Case creation.