Table of Contents

Configuring property assertions


Only available versions of this content are shown in the dropdown

You can configure property assertions to validate that the actual values of properties returned by a rule are the expected values. You can also assert if a property has an error and, if it does, what the message is so that you can validate that the message is correct.

For example, you can create an assertion that verifies that a customer ID, which appears only once on a data page, is equal to 834234.

Open the unit test case. For more information, see Opening a unit test case.
  1. On the bottom of the Definition tab, click Add expected result.

  2. In the Assertion type list, select Property, and then click Add properties.

  3. Select the properties to add by doing one of the following.

    • For data transforms, activities, flows, or case types, in the Actual results section, select the page containing the properties to add.
    • For other rules, select the property or page that you want to add.
    Properties are displayed in the righte pane. If you selected a page, then all embedded pages and properties from the page are added.
  4. To add another property or page, click Add row, and then repeat step 3.

    When you add multiple properties, the assertion passes if the expected output and results match for all properties.

  5. In the Comparator list, select the comparator that you want to use to compare the property with a specified value. Do one of the following:

    • Select the is in comparator to compare a text, integer, or decimal property to multiple values. The assertion passes if the property matches any of the values that you specify.

    • Select the is not in comparator. The assertion passes if the property does not match any of the values that you specify.

    • Select the has error with message comparator to verify that the property has the exact message that you specify in the Value box.
    • Select the has error message that contains comparator to verify that the property has a portion of the message that you specify in the Value box.
  6. In the Value field, enter a value with which to compare the property. Separate values for the comparators by using the pipe (|) character. For text properties, use double quotation marks at the beginning and end of the value, for example, "23|15|88" .

    For example, if you want the assertion to pass when Age property matches either the 5 or 7 values, configure the assertion as .Age is in 5|7 .

  7. Optional:

    To add a comment, click the Add comment icon, enter a comment, and then click OK.

  8. Click Save.

  • 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.

  • Building expressions with the Expression Builder

    Author expressions using the Expression Builder by completing the following steps:

Suggest Edit

Have a question? Get answers now.

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