Back Forward How to unit test a map value rule

About Map Value rules

C-2409 C-1493 You can test a map value rule as a unit, before or after it is integrated into the rest of the application you are developing. B-17319 circumstance NORIR

Preparation

  1. Review the Applies To key part and Pages & Classes tab of the rule, to identify the class of the pages that the map value rule uses for input and the properties involved in the rule.
  2. When feasible, perform any necessary processing to create or load a clipboard page or pages that supply some or all of the properties needed. For example, if the Applies To class involves a work type, you can open a work object of the corresponding class. Unit testing does not alter these pages.
  3. For more comprehensive testing, create one or more model rules that load various sets of input values.

Test approach

For basics of unit testing, see Unit testing a rule with the Run toolbar button.

  1. Save the Map Value form.
  2. Click the Run toolbar button (Run) or the equivalent keyboard shortcut CTRL + R to open a guided test window.
  3. The system presents a list of clipboard pages that may match the Applies To key part. Select the clipboard page that is to be a major source of values for the rule. If no page of the appropriate type is present, select Create or Reset Test page. (If this map value rule applies to an embedded page, identify a top-level page that contains the embedded page or pages and supply a Page Context. VAGUE C-2560)
  4. SmartPrompt In the Apply field, select a model rule to be applied to the empty test page.
  5. If the rule being tested is circumstance-qualified, select Set circumstance properties to run exact version of rule. Otherwise, the base version or a different circumstance-qualified version may be the one tested.
  6. Click  Create Page and Run Rule  . The system makes a temporary copy of the page you selected (or creates a new temporary page and applies the model rule), executes the map value rule, and displays the result.
  7. Click the link labeled Result Decision Paths to redisplay the Matrix tab with a green background for the cell that produced the test result. C-1637 NORIR
  8. Click  Show Clipboard   to start the Clipboard tool within this page. Any changes you make with the Clipboard tool to pages involved in testing do not affect normal processing. Click  Hide Clipboard   to close the tool. B-20333B-20454 rejected not refreshed
  9. Click  Run Again   to repeat the test.
  10. Repeat as desired, selecting different model rules or altered clipboard contents.

Up About Map Value rules