Configuring decision result assertions

After you create a PegaUnit test case for a decision table or decision tree, the system generates a decision result assertion. This assertion displays the input values used to test the rule and the result generated by the rule, as provided in the Decision result section in the Run Rule dialog box.

Note: This assertion is supported on when rules, decision tables, and decision trees only.

You can modify the input values and the default decision result by completing the following steps:

  1. Complete one of the following actions:

    • Open the PegaUnit test case if it is not already open, and then click the Definition tab.

    • If the PegaUnit test case is open and you have not saved the case, click Done on the Definition tab.

  1. Add either multiple input values and results to the assertion, or add other assertions.
    Note:
    • You can add multiple input values and results to this assertion but cannot add other assertion types to this test case.

    • You can add other assertion types to this test case only if you have a single input and result entry for the assertion.

    Complete one of the following actions:

    • Add multiple input values and results to the assertion.

      Complete the following steps:

      1. Click the Multiple input combinations check box.

      2. Enter values for the input and result that you expect the assertion to generate when the test stops running.

      3. Click Add and enter values for each additional input and result that you want to test.

    • To use one input value and result, enter the values that you expect the assertion to generate when the test stops running. You can then add additional assertions to the test case.

  2. Save the rule form.

    The test case runs the decision tree or decision table with each input combination and compares the result with the expected decision result for that combination.

    It then either runs other decision result combinations or other assertions that are configured. If the expected result of any of the input combinations in the decision result assertion does not match the result that the rule returns, the assertion fails.