object Table
Object containing one apply
factory method for each TableFor<n>
class.
For example, you could create a table of 5 rows and 2 colums like this:
import org.scalatest.prop.Tables._
val examples = Table( ("a", "b"), ( 1, 2), ( 2, 4), ( 4, 8), ( 8, 16), ( 16, 32) )
Because you supplied 2 members in each tuple, the type you'll get back will be a TableFor2
. If
you wanted a table with just one column you could write this:
val moreExamples = Table( "powerOfTwo", 1, 2, 4, 8, 16 )
Or if you wanted a table with 10 columns and 10 rows, you could do this:
val multiplicationTable = Table( ("a", "b", "c", "d", "e", "f", "g", "h", "i", "j"), ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10), ( 2, 4, 6, 8, 10, 12, 14, 16, 18, 20), ( 3, 6, 9, 12, 15, 18, 21, 24, 27, 30), ( 4, 8, 12, 16, 20, 24, 28, 32, 36, 40), ( 5, 10, 15, 20, 25, 30, 35, 40, 45, 50), ( 6, 12, 18, 24, 30, 36, 42, 48, 54, 60), ( 7, 14, 21, 28, 35, 42, 49, 56, 63, 70), ( 8, 16, 24, 32, 40, 48, 56, 64, 72, 80), ( 9, 18, 27, 36, 45, 54, 63, 72, 81, 90), ( 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) )
The type of multiplicationTable
would be TableFor10
. You can pass the resulting
tables to a forAll
method (defined in trait PropertyChecks
), to perform a property
check with the data in the table. Or, because tables are sequences of tuples, you can treat them as a Seq
.
- Source
- Tables.scala
- Alphabetic
- By Inheritance
- Table
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)*): TableFor22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V]
Factory method for creating a new
TableFor22
.Factory method for creating a new
TableFor22
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple22
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)*): TableFor21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]
Factory method for creating a new
TableFor21
.Factory method for creating a new
TableFor21
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple21
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)*): TableFor20[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T]
Factory method for creating a new
TableFor20
.Factory method for creating a new
TableFor20
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple20
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)*): TableFor19[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S]
Factory method for creating a new
TableFor19
.Factory method for creating a new
TableFor19
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple19
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)*): TableFor18[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R]
Factory method for creating a new
TableFor18
.Factory method for creating a new
TableFor18
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple18
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)*): TableFor17[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q]
Factory method for creating a new
TableFor17
.Factory method for creating a new
TableFor17
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple17
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)*): TableFor16[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P]
Factory method for creating a new
TableFor16
.Factory method for creating a new
TableFor16
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple16
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)*): TableFor15[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O]
Factory method for creating a new
TableFor15
.Factory method for creating a new
TableFor15
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple15
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M, N](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M, N)*): TableFor14[A, B, C, D, E, F, G, H, I, J, K, L, M, N]
Factory method for creating a new
TableFor14
.Factory method for creating a new
TableFor14
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple14
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L, M](heading: (String, String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L, M)*): TableFor13[A, B, C, D, E, F, G, H, I, J, K, L, M]
Factory method for creating a new
TableFor13
.Factory method for creating a new
TableFor13
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple13
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K, L](heading: (String, String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K, L)*): TableFor12[A, B, C, D, E, F, G, H, I, J, K, L]
Factory method for creating a new
TableFor12
.Factory method for creating a new
TableFor12
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple12
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J, K](heading: (String, String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J, K)*): TableFor11[A, B, C, D, E, F, G, H, I, J, K]
Factory method for creating a new
TableFor11
.Factory method for creating a new
TableFor11
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple11
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I, J](heading: (String, String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I, J)*): TableFor10[A, B, C, D, E, F, G, H, I, J]
Factory method for creating a new
TableFor10
.Factory method for creating a new
TableFor10
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple10
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H, I](heading: (String, String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H, I)*): TableFor9[A, B, C, D, E, F, G, H, I]
Factory method for creating a new
TableFor9
.Factory method for creating a new
TableFor9
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple9
s containing the data of this table
- def apply[A, B, C, D, E, F, G, H](heading: (String, String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G, H)*): TableFor8[A, B, C, D, E, F, G, H]
Factory method for creating a new
TableFor8
.Factory method for creating a new
TableFor8
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple8
s containing the data of this table
- def apply[A, B, C, D, E, F, G](heading: (String, String, String, String, String, String, String), rows: (A, B, C, D, E, F, G)*): TableFor7[A, B, C, D, E, F, G]
Factory method for creating a new
TableFor7
.Factory method for creating a new
TableFor7
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple7
s containing the data of this table
- def apply[A, B, C, D, E, F](heading: (String, String, String, String, String, String), rows: (A, B, C, D, E, F)*): TableFor6[A, B, C, D, E, F]
Factory method for creating a new
TableFor6
.Factory method for creating a new
TableFor6
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple6
s containing the data of this table
- def apply[A, B, C, D, E](heading: (String, String, String, String, String), rows: (A, B, C, D, E)*): TableFor5[A, B, C, D, E]
Factory method for creating a new
TableFor5
.Factory method for creating a new
TableFor5
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple5
s containing the data of this table
- def apply[A, B, C, D](heading: (String, String, String, String), rows: (A, B, C, D)*): TableFor4[A, B, C, D]
Factory method for creating a new
TableFor4
.Factory method for creating a new
TableFor4
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple4
s containing the data of this table
- def apply[A, B, C](heading: (String, String, String), rows: (A, B, C)*): TableFor3[A, B, C]
Factory method for creating a new
TableFor3
.Factory method for creating a new
TableFor3
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple3
s containing the data of this table
- def apply[A, B](heading: (String, String), rows: (A, B)*): TableFor2[A, B]
Factory method for creating a new
TableFor2
.Factory method for creating a new
TableFor2
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple2
s containing the data of this table
- def apply[A](heading: String, rows: A*): TableFor1[A]
Factory method for creating a new
TableFor1
.Factory method for creating a new
TableFor1
.- heading
a tuple containing string names of the columns in this table
- rows
a variable length parameter list of
Tuple1
s containing the data of this table
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()