Converts every column, input and expectation alike
All 3 scenarios hold
A static @TypeConverter method in the test class decides what a cell's text becomes. A table can then use the language of the domain, in place of programmer literals.
Three converters serve the tables below. Yes/No becomes a boolean. A number word becomes an integer. A day word becomes a date.
Each rule below keeps the conversion visible. Each table pairs the text of the cell with the value the test method receives, printed back as plain text. That column is a String, and no converter touches a String. The column therefore shows what the converter produced, and does not restate what the converter was given.
The expected sum is a number word too. The digits column shows the sum the test method computes from the converted parameters.
| Scenario | int | Integer | Sum? | Sum in digits? |
|---|---|---|---|---|
| One and three | one | three | four | 4 |
| Two and two | two | two | four | 4 |
| Two and three | two | three | five | 5 |