Previous Topic

Next Topic

Book Contents

Write test cases for a rule or global condition

  1. In the Project Explorer, select a study design (in a study only), study element, study event, form, section, or item.
  2. Select the Rules tab.
  3. Optionally, to see the rules' child rules click Show Child Rules.
  4. Select a rule, and click Rule Tests.
  5. In the list of rules on the left of the Rule Test Cases dialog box, select a rule.

    Tip Tips:

    • To filter the list of rules, select an existing filter from the Filters drop-down list, or click the Filters button to create a new filter.
    • To locate a rule, in the Find field, type all or part of the rule name, and press Enter.
  6. In the toolbar, click Create.
  7. Provide test values for the items that are used in the rule:
    • 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.
    • Item on a repeating section, form, or study event—Click the box at the end of the field, and provide values in the dialog box that appears.

    Note: To provide an empty value for an item with a codelist, select the <empty> option. For items without a codelist, do not enter a value in the field. The field changes to <empty>.

    Note: To enter test cases without using a mouse, use the Tab key to advance to cells. Use the spacebar to open dialog boxes from within cells, such as the date picker dialog box.

  8. In the Expected Result field, do one of the following:

    Note: For data-entry rules, one Expected Result field appears for each of the rule actions.

    • For data-entry rules: Select the expected result or type the expected value, based upon the values that you provided in the test case. For example:
      • Rule issues a query—Select QUERY or NOQUERY.
      • Rule sends an email message—Select Sent or Not Sent.
      • Rule sets a value—Calculate and type the expected value. For example, for a BMI rule, use the Height and Weight values in the test case to calculate the value.
    • For workflow rules: Select the study object that you expect to appear next in the workflow, based upon the test case.
    • For global conditions: Select True or False, depending on how you expect the expression to evaluate based on the test case.
  9. At the bottom of the dialog box, click Save Tests.
  10. Write additional test cases as necessary. Optionally, use Copy and Paste on the toolbar to create test cases.

Note: To run test cases for a rule that references third-party code (for example, ODP.NET), the referenced third-party components must be installed on the client computer.

Send Feedback