Chapter 8. Expression syntax in test scenarios
The test scenarios designer supports different expression languages for both rule-based and DMN-based test scenarios. While rule-based test scenarios support a basic expression language, DMN-based test scenarios support the FEEL expression language.
8.1. Expression syntax in rule-based test scenarios
The following rule-based test scenario definition expressions are supported by the test scenarios designer:
Operator | Description |
---|---|
= | Specifies equal to a value. This is default for all columns and is the only operator supported by the GIVEN column. |
=, =!, <> | Specifies inequality of a value. This operator can be combined with other operators. |
<, >, <=, >= | Specifies 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. |
An empty cell is skipped from evaluation. To define an empty string, use =
,[]
, or ;
. To define a null value, use null
.
Expression | Description |
---|---|
-1 | The actual value is equal to -1. |
< 0 | The actual value is less than 0. |
! > 0 | The actual value is not greater than 0. |
[-1, 0, 1] | The actual value is equal to either -1 or 0 or 1. |
<> [1, -1] | The actual value is neither equal to 1 nor -1. |
! 100; 0 | The actual value is not equal to 100 but is equal to 0. |
!= < 0; <> > 1 | The actual value is neither less than 0 nor greater than 1. |
<> <= 0; >= 1 | The actual value is neither less than 0 nor equal to 0 but is greater than or equal to 1. |
You can refer to the supported commands and syntax in the Scenario Cheatsheet tab on the right of the rule-based test scenarios designer.
8.2. Expression syntax in DMN-based scenarios
The following data types are supported by the DMN-based test scenarios in the test scenarios designer:
Supported data types | Description |
---|---|
numbers & strings |
Strings must be delimited by quotation marks, for example, |
boolean values |
|
dates and time |
For example, |
functions | |
contexts |
For example, |
ranges and lists |
For example, |
You can refer to the supported commands and syntax in the Scenario Cheatsheet tab on the right of the DMN-based test scenarios designer.