Class

org.scalatest.prop

SizeParam

Related Doc: package prop

Permalink

case class SizeParam(minSize: PosZInt, sizeRange: PosZInt, size: PosZInt) extends Product with Serializable

Describes the "size" to use in order to generate a value.

The Generator.next() function takes a SizeParam as a parameter, and uses it if it is relevant to this Generator.

The semantics of "size" depend on the Generator and the type it is producing. For a simple scalar such as an Int or a Float, "size" is irrelevant, and the parameter is ignored. For a String, the "size" is the length of the desired String. For a List, the "size" is the length of the desired List. And so on -- in general, the meaning of "size" is usually pretty intuitive.

The SizeParam data structure represents both a target size range and a specific size.

The minSize member says the smallest allowed size; the sizeRange is added to minSize to get the largest allowed size. So if minSize is 10 and sizeRange is 0, that means that 10 is the only size desired; if minSize is 10 and sizeRange is 10, then values from 10 to 20 are desired.

The size member gives the desired size for this particular invocation of Generator.next(). Most Generators will create a result of that size. However, it is up to the individual Generator to choose how it interprets SizeParam.

You should not usually need to create a SizeParam directly -- most of the time, you should be able to use the HavingSize or HavingLength traits to describe the desired sizes of your Generators. You may occasionally need to manipulate SizeParam directly if you want to use HavingSize.havingSizesDeterminedBy(), or if you want to call Generator.next() directly.

minSize

the minimum desired size for this Generator or invocation

sizeRange

the range above minSize to consider allowable

size

the actual size to use for this specific invocation of Generator.next()

Source
SizeParam.scala
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SizeParam
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SizeParam(minSize: PosZInt, sizeRange: PosZInt, size: PosZInt)

    Permalink

    minSize

    the minimum desired size for this Generator or invocation

    sizeRange

    the range above minSize to consider allowable

    size

    the actual size to use for this specific invocation of Generator.next()

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  8. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  9. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  10. val maxSize: PosZInt

    Permalink

    The maximum size to allow.

    The maximum size to allow. Calculated from minSize and sizeRange.

  11. val minSize: PosZInt

    Permalink

    the minimum desired size for this Generator or invocation

  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. val size: PosZInt

    Permalink

    the actual size to use for this specific invocation of Generator.next()

  16. val sizeRange: PosZInt

    Permalink

    the range above minSize to consider allowable

  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped