Business Rules Tables
Business Rules Tables are used to define acceptance tests for rules in your business domain that need to be tested with different sets of data.
The tables have a set of data columns and one or more assertion columns. If a set of input data (i.e., a rule) fails during execution, the remaining rows will still be executed.
A Business Rule Table has two kinds of columns:
- Input column - These columns represent input data for the given rule.
- Assertion column - These columns represent an expectation. The row fails if, during execution, the value of the column is different from the value specified. Assertion columns have a question mark at the end.
In Twist, a Business Rules Table to test the functionality for calculating Simple Interest might be described as follows.
|Principal||Tenure||Rate of interest||Interest?|
|-100||4||6||Invalid Principal amount|
|3100||4||-6||Invalid Rate of interest|