Package com.tngtech.jgiven
Class DataTables
java.lang.Object
com.tngtech.jgiven.DataTables
A utility class to create data tables.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DataTables
public DataTables()
-
-
Method Details
-
table
Creates a table, i.e. a list of lists, withnumberOfColumnscolumns from the givendataincluding the header.Example:
table(2, "name", "age", // header "Peter", 20, // first row of data "Susan", 35); // second row of data- Parameters:
numberOfColumns- the number of columns the resulting table should havedata- the data of the table represented as a one-dimensional list, the number of entries must be a multiple ofnumberOfColumns. The firstnumberOfColumnselements are taken as the header of the table, the remaining values as data- Returns:
- a list of list that contains the same data as
data, but in a two-dimensional form - Throws:
IllegalArgumentException- ifdata.length % numberOfColumns != 0
-