To create a test template, define the "Given" and "Expect" columns by using the expression editor below.



Clear

To start off, right-click a cell in the table and use the contextual menus to insert new columns and rows.

Before defining the individual test scenarios, set the instance and field mappings for each column. Select a header cell and in the Test Editor tab, choose the required field. Click Add to set the mapping.

Now, define the test scenarios. Each cell of the table must contain a valid expression.

In rule-based scenarios, the following expressions are supported:

  • = (or no symbol) specifies equality of a value. This is the default operator of each column and the only operator that is supported in the GIVEN section of the table.
  • !, !=, <> specify inequality of a value. This operator can be combined with other operators.
  • <, >, <=, >= specify a comparison: less than, greater than, less or equals than, and greater or equals than.
  • [value1, value2, value3] specifies a list of values. If one or more values are valid, the scenario definition is evaluated as true.
  • expression1; expression2; expression3 specifies a list of expressions. If all expressions are valid, the scenario definition is evaluated as true.
  • To define an empty string, use =, [], or ;. To define a null value, use null. An empty cell is skipped from the evaluation.

Example expressions:

  • < 1
  • < 1; ! [-1, 0]
  • [Jane, Doe]
  • <> [1, -1]; = 0

To start off, right-click a cell in the table and use the contextual menus to modify the generated table as required.

Before defining the individual test scenarios, verify the instance and field mappings for each column. If any changes are necessary, use the Test Editor tab to update the mapping.

Now, define the test scenarios. Each cell of the table must contain a valid expression.

Values in the GIVEN part of the table are evaluated as literal expressions, whereas values in the EXPECT section are evaluated as unary expressions. The correctness of these unary tests is verified using the results from a DMN evaluation.

DMN-based scenarios use the FEEL expression language. Supported data types are:

  • numbers and strings (strings must be delimited by quotation marks), for example "John Doe" or ""
  • boolean values (true, false, and null)
  • dates and time, for example date("2019-05-13") or time("14:10:00+02:00")
  • functions
  • contexts, for example {x : 5, y : 3}
  • ranges and lists, for example [1 .. 10] or [2, 3, 4, 5]

An empty cell is skipped from the evaluation.