Keyboard

↓ ↑
move between the rows you can see
→
open a feature, then step into it
←
close a feature, or step out to the one above
Enter
go to the page in focus
Tab
the same rows, plus everything else on the page
/
search the whole report
m
open or close the navigation drawer
Esc
leave the search box, or close the drawer
?
this list

Applies a converter to the elements inside a collection

All 2 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.

expected outcome broken scenario
ScenarioNumber wordsElement type?Sum in digits?
Two words
  • one
  • three
java.lang.Integer4
Repeated word
  • two
  • two
  • two
java.lang.Integer6