Configuring case instance count assertions
For flows and case types, you can verify the number of cases that were created when the case type or flow was run.
For example, a Job Application case type runs a child case that processes background checks. If you record the entire Job Applicant case type and the child case type, the number of case instances for Job Application case type is one, and the number of case instances of Background Check child case type is one.
If you do not run the run the Background Check child case type when you create the test case, the number of Background Check case instances is zero.
On the bottom of the Definition tab, click Add expected result.
From the Assertion type list, select Case instance count.
In the Of case type field, do one of the following:
- To select a case type from your work pool, press the Down Arrow key and select the case type.
- Enter a case type that is not part of your work pool.
Select a comparator from the Comparator list.
In the Value field, enter the number of cases to compare against the output.
Click Add to add another case instance count assertion and repeat steps 4 through 6.
To add a comment, click the Add comment icon, enter a comment, and click OK.
- 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.