Write a test case for a rule with an item on a repeating study object
When you write a test case and one of the items in a rule is on a repeating study object, you can provide test values for each instance of the item. For more information about writing test cases, see Write a test case for a rule or global condition.
- In the Project Explorer, select a study design (in a study only), study element, study event, form, section, or item.
- Select the Rules tab.
- Optionally, to see the rules' child rules click Show Child Rules.
- Select a rule, and click Rule Tests.
- In the list of rules on the left of the Rule Test Cases dialog box, select a rule.
- In the cell that contains <repeating>, click the box at the end of the cell.
- To create a test instance for an additional instance of the repeating study object:
- Select the study object.
- Click either Add Repeating Instance or Copy Repeating Instance.
For example, if a rule refers to an item on a repeating form, you can specify an item path for each instance of the repeating form on which the item exists.
- To mark an instance of the repeating study object as current or deleted, right-click the study object path, and select either Mark as Current or Mark as Deleted.
Note: The first repeating instance is marked as current after you create a test case.
- Provide test values for the items that are used in the rule:
Note: You can select any study object in the tree to provide values. Values of child study objects also appear in the grid for their parents. If the rule contains multiple items that are children of repeating study objects, they are listed in the Repeating Items section; select an item to provide its test values in the grid.
- Item with a single-select codelist—From the drop-down list, select a codelist item to test. The code and label appear in the drop-down list. To view the RefName, select the Test Properties tab, and then point to the item in the grid.
- Item with a multi-select codelist—Click the box at the end of the field, and select one or more codelist items to test.
- Item without a codelist—Type the value to test. For an integer, float, or text item, you must follow the item's requirements, which appear in the Test Properties tab when you point to an item.
- Date time item—Provide values for the parts of the date time item that are allowed.
- To test for an empty date, select Empty date, or select Empty for a date time component.
- To test for an unknown value, select Unknown for a date time component. Unknown is available only if an unknown value is allowed for the date time part and if the date time part is not required.
- Click OK.
- At the bottom of the dialog box, click Save Tests.