By default, the name of each test is simply the
toString() on the input row. This typically works well for data
However, we can customize this if we wish, by passing in test names into the
withData function in the form of map,
where the key is the test name, and the value is the input value for that row.
Or we can pass a function to
withData which take
row as input and return the test name.
The output from this example is now slightly clearer:
Another alternative is to implement the
WithDataTestName interface. When provided, the
toString() will not be used,
dataTestName function will be invoked for each row.
Finally, another option is to provide a function directly to the
Whether this is worth the extra effort or not depends on how readable the toString() method is on the data classes you are using.