a tuple containing string names of the columns in this table
a variable length parameter list of Tuple16
s containing the data of this table
Applies the passed property check function to each row of this TableFor16
.
Applies the passed property check function to each row of this TableFor16
.
If the property checks for all rows succeed (the property check function returns normally when passed
the data for each row), this apply
method returns normally. If the property check function
completes abruptly with an exception for any row, this apply
method wraps that exception
in a TableDrivenPropertyCheckFailedException
and completes abruptly with that exception. Once
the property check function throws an exception for a row, this apply
method will complete
abruptly immediately and subsequent rows will not be checked against the function.
the property check function to apply to each row of this TableFor16
Selects a row of data by its index.
Selects a row of data by its index.
a tuple containing string names of the columns in this table
The number of rows of data in the table.
The number of rows of data in the table. (This does not include the heading
tuple)
Creates a new Builder
for TableFor16
s.
Creates a new Builder
for TableFor16
s.
(Changed in version 2.9.0) The behavior of scanRight
has changed. The previous behavior can be reproduced with scanRight.reverse.
A string representation of this object, which includes the heading strings as well as the rows of data.
A string representation of this object, which includes the heading strings as well as the rows of data.
(Changed in version 2.9.0) transpose
throws an IllegalArgumentException
if collections are not uniformly sized.
A table with 16 columns.
For an introduction to using tables, see the documentation for trait TableDrivenPropertyChecks.
This table is a sequence of
Tuple16
objects, where each tuple represents one row of the table. The first element of each tuple comprise the first column of the table, the second element of each tuple comprise the second column, and so on. This table also carries with it a heading tuple that gives string names to the columns of the table.A handy way to create a
TableFor16
is via anapply
factory method in theTable
singleton object provided by theTables
trait. Here's an example:Because you supplied 16 members in each tuple, the type you'll get back will be a
TableFor16
.The table provides an
apply
method that takes a function with a parameter list that matches the types and arity of the tuples contained in this table. Theapply
method will invoke the function with the members of each row tuple passed as arguments, in ascending order by index. (I.e., the zeroth tuple is checked first, then the tuple with index 1, then index 2, and so on until all the rows have been checked (or until a failure occurs). The function represents a property of the code under test that should succeed for every row of the table. If the function returns normally, that indicates the property check succeeded for that row. If the function completes abruptly with an exception, that indicates the property check failed and theapply
method will complete abruptly with aTableDrivenPropertyCheckFailedException
that wraps the exception thrown by the supplied property function.The usual way you'd invoke the
apply
method that checks a property is via aforAll
method provided by traitTableDrivenPropertyChecks
. TheforAll
method takes aTableFor16
as its first argument, then in a curried argument list takes the property check function. It invokesapply
on theTableFor16
, passing in the property check function. Here's an example:Because
TableFor16
is aSeq[(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)]
, you can use it as aSeq
. For example, here's how you could get a sequence ofOutcome
s for each row of the table, indicating whether a property check succeeded or failed on each row of the table:Note: the
outcomeOf
method, contained in theOutcomeOf
trait, will execute the supplied code (a by-name parameter) and transform it to anOutcome
. If no exception is thrown by the code,outcomeOf
will result in aSucceeded
, indicating the "property check" succeeded. If the supplied code completes abruptly in an exception that would normally cause a test to fail,outcomeOf
will result in in aFailed
instance containing that exception. For example, the previous for expression would give you:This shows that all the property checks succeeded, except for the one at index 7.