Close popover

Table of Contents

Configuring decision result assertions

Version:

After you create a unit test case for a decision table or decision tree, the system generates a decision result assertion. This assertion displays the input values for testing the rule, and the result that is generated by the rule.

You can manually update the input values, add properties, remove properties, and modify the default decision result if the test is modified.

This assertion is supported on when rules, decision tables, and decision trees only.
Open the unit test case. For more information, see Opening a unit test case.

  1. Click the Definition tab.

  2. To add multiple input values and results to the assertion, or add other assertions, perform one of the following actions:

    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.
    • To add multiple input values and results to the assertion:
      1. Select 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.
  3. To update the assertion to reflect properties that were added to the rule, click Refresh.

    Refresh updates the assertion with properties that are added to the rule. If properties have been removed from the rule, then you need to manually remove the properties from the assertion.
  4. Add or remove properties by clicking Manage properties and then entering the changes. You need to enter data for properties that were added to the rule.

    The properties are reflected as unexpected results in test case results.
  5. In the rule form, click Save.

    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.

    Other decision result combinations or other configured assertions then run. 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.

  • Defining expected test results with assertions

    Use unit test cases to compare the expected output of a rule to the actual results returned by running the rule. To define the expected output, you configure assertions (test conditions) on the test cases that the test, when run, compares to the results returned by the rule.

  • Converting unit tests to test cases
  • Creating unit test cases for rules

    For most rules, you can create a reusable test case by converting a unit test to a test case, configuring case details, and then defining expected test results with assertions (test conditions). When the test case runs, the test results are compared to the expected results defined for the rule’s assertions. If the test results do not meet the defined assertions, then the test fails.

Suggest Edit

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.