TrialsSkeletalImplementation

com.sageserpent.americium.TrialsSkeletalImplementation
trait TrialsSkeletalImplementation[Case] extends Trials[Case]

Attributes

Graph
Supertypes
trait Trials[Case]
trait TrialsScaffolding[Case]
trait TrialsFactoring[Case]
class Object
trait Matchable
class Any
Show all
Known subtypes
class TrialsImplementation[Case]

Members list

Type members

Inherited classlikes

abstract class TrialException(cause: Throwable) extends RuntimeException

Attributes

Inherited from:
TrialsFactoring
Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Inherited types

override type SupplySyntaxType <: SupplyToSyntax[Case]

Attributes

Inherited from:
Trials

Value members

Abstract methods

override def lotsOfSize[Collection](size: Int)(implicit factory: Factory[Case, Collection]): TrialsSkeletalImplementation[Collection]

Transform this to a trials of collection, where Collection is some kind of collection that can be built from elements of type Case by a Factory. The collection instances yielded by the result are all built from the specified number of elements.

Transform this to a trials of collection, where Collection is some kind of collection that can be built from elements of type Case by a Factory. The collection instances yielded by the result are all built from the specified number of elements.

Type parameters

Collection

Any kind of collection that can take an arbitrary number of elements of type Case.

Value parameters

factory

A Factory that can build a Collection.

size

The number of elements of type Case to build the collection instance from. Be aware that sets, maps and bounded size collections don't have to accept that many elements.

Attributes

Returns

A [[Trials]] instance that yields Collection instances.

Definition Classes
override def several[Container](implicit factory: Factory[Case, Container]): TrialsSkeletalImplementation[Container]

Transform this to a trials of collection, where Collection is some kind of collection that can be built from elements of type Case by a Factory.

Transform this to a trials of collection, where Collection is some kind of collection that can be built from elements of type Case by a Factory.

Type parameters

Collection

Any kind of collection that can take an arbitrary number of elements of type Case.

Value parameters

factory

A Factory that can build a Collection.

Attributes

Returns

A Trials instance that yields Collection instances.

Definition Classes

Concrete methods

override def and[Case2](secondTrials: Trials[Case2]): Tuple2Trials[Case, Case2]

Fluent syntax to allow trials to be combined prior to calling TrialsScaffolding.withLimit etc. This grants the user the choice of either supplying the combined trials in the usual way, in which case the Function will take a Tuple2 parameterised by types Case and Case2, or a Function2 can be used taking separate arguments of types Case and Case2.

Fluent syntax to allow trials to be combined prior to calling TrialsScaffolding.withLimit etc. This grants the user the choice of either supplying the combined trials in the usual way, in which case the Function will take a Tuple2 parameterised by types Case and Case2, or a Function2 can be used taking separate arguments of types Case and Case2.

This can be repeated up to a limit by calling and on the results to add more trials - this enables supply to consumers of higher argument arity.

Attributes

Returns

Syntax object that permits the test code to consume either a pair or two separate arguments.

Definition Classes
override def filter(predicate: Case => Boolean): TrialsImplementation[Case]

Attributes

Definition Classes
override def flatMap[TransformedCase](step: Case => Trials[TransformedCase]): TrialsImplementation[TransformedCase]

Attributes

Definition Classes
override def lists: TrialsSkeletalImplementation[List[Case]]

Attributes

Definition Classes
override def listsOfSize(size: Int): TrialsSkeletalImplementation[List[Case]]

Attributes

Definition Classes
override def map[TransformedCase](transform: Case => TransformedCase): TrialsImplementation[TransformedCase]

Attributes

Definition Classes
override def mapFilter[TransformedCase](filteringTransform: Case => Option[TransformedCase]): TrialsImplementation[TransformedCase]

Attributes

Definition Classes
override def maps[CovarianceFudge >: Case, Value](values: Trials[Value]): TrialsSkeletalImplementation[Map[CovarianceFudge, Value]]

Attributes

Definition Classes
override def options: TrialsImplementation[Option[Case]]

Attributes

Returns

A lifted trials that wraps the underlying cases from this in an Option; the resulting trials also supplies a special case of Option.empty.

Definition Classes
override def or[Case2](alternativeTrials: Trials[Case2]): TrialsImplementation[Either[Case, Case2]]

Fluent syntax to allow trials of dissimilar types to be supplied as alternatives to the same test. In contrast to the TrialsApi.alternate, the alternatives do not have to conform to the same type; instead here we can switch in the test between unrelated types using an Either instance to hold cases supplied from either this trials instance or from alternativeTrials.

Fluent syntax to allow trials of dissimilar types to be supplied as alternatives to the same test. In contrast to the TrialsApi.alternate, the alternatives do not have to conform to the same type; instead here we can switch in the test between unrelated types using an Either instance to hold cases supplied from either this trials instance or from alternativeTrials.

Attributes

Returns

[[Either]] that is populated with either a Case or with a Case2.

Definition Classes
override def sets[CovarianceFudge >: Case]: TrialsSkeletalImplementation[Set[CovarianceFudge]]

Attributes

Definition Classes
override def sortedMaps[CovarianceFudge >: Case, Value](values: Trials[Value])(implicit ordering: Ordering[CovarianceFudge]): TrialsSkeletalImplementation[SortedMap[CovarianceFudge, Value]]

Attributes

Definition Classes
override def sortedSets[CovarianceFudge >: Case](implicit ordering: Ordering[CovarianceFudge]): TrialsSkeletalImplementation[SortedSet[CovarianceFudge]]

Attributes

Definition Classes

Inherited methods

def javaTrials[CovarianceFudge >: Case]: Trials[CovarianceFudge]

This is mostly just for implementation purposes, as the Java incarnation com.sageserpent.americium.java.Trials is effectively a wrapper around the Scala incarnation Trials. However, if you want to pull cases via an iterator, this is handy as currently the iterator access is via the Java incarnation.

This is mostly just for implementation purposes, as the Java incarnation com.sageserpent.americium.java.Trials is effectively a wrapper around the Scala incarnation Trials. However, if you want to pull cases via an iterator, this is handy as currently the iterator access is via the Java incarnation.

Attributes

Returns

The Java incarnation com.sageserpent.americium.java.Trials of this instance

Inherited from:
Trials
def reproduce(recipe: String): Case

Reproduce a specific case in a repeatable fashion, based on a recipe.

Reproduce a specific case in a repeatable fashion, based on a recipe.

Value parameters

recipe

This encodes a specific case and will only be understood by the same value of trials instance that was used to obtain it.

Attributes

Returns

The specific Case denoted by the recipe.

Throws
RuntimeException

if the recipe does not correspond to the receiver, either due to it being created by a different flavour of trials instance or subsequent code changes.

Inherited from:
TrialsFactoring
def trials: Trials[Case]

Use this to lose any specialised supply syntax and go back to the regular Trials API. The motivation for this is when the and combinator is used to glue together several trials instances, but we want to treat the result as a plain trials of tuples, rather than calling Trials.withLimits etc there and then.

Use this to lose any specialised supply syntax and go back to the regular Trials API. The motivation for this is when the and combinator is used to glue together several trials instances, but we want to treat the result as a plain trials of tuples, rather than calling Trials.withLimits etc there and then.

Attributes

Returns

The equivalent Trials instance.

Inherited from:
TrialsScaffolding
def withFilter(predicate: Case => Boolean): Trials[Case]

Attributes

Inherited from:
Trials
def withLimit(limit: Int): SupplySyntaxType

Fluent syntax for configuring a limit to the number of cases supplied to a consumer.

Fluent syntax for configuring a limit to the number of cases supplied to a consumer.

Value parameters

limit

The maximum number of cases that can be supplied - note that this is no guarantee that so many cases will be supplied, it is simply a limit.

Attributes

Returns

An instance of SupplyToSyntax with the limit configured.

Inherited from:
TrialsScaffolding
def withStrategy(casesLimitStrategyFactory: CaseSupplyCycle => CasesLimitStrategy, complexityLimit: Int, shrinkageAttemptsLimit: Int, shrinkageStop: () => Case): SupplySyntaxType

Fluent syntax for configuring a limit strategy for the number of cases supplied to a consumer.

Fluent syntax for configuring a limit strategy for the number of cases supplied to a consumer.

Value parameters

casesLimitStrategyFactory

A factory method that should produce a fresh instance of a CasesLimitStrategy on each call.

Attributes

Returns

An instance of SupplyToSyntax with the strategy configured.

Note

The factory casesLimitStrategyFactory takes an argument of CaseSupplyCycle; this can be used to dynamically configure the strategy depending on which cycle the strategy is intended for, or simply disregarded if a one-size-fits-all approach is desired.

Inherited from:
TrialsScaffolding

Deprecated and Inherited methods

def withLimits(casesLimit: Int, complexityLimit: Int, shrinkageAttemptsLimit: Int, shrinkageStop: () => Case): SupplySyntaxType

Attributes

Deprecated
true
Inherited from:
TrialsScaffolding
def withRecipe(recipe: String): SupplySyntaxType

Attributes

Deprecated
true
Inherited from:
TrialsScaffolding

Inherited fields

val generation: Free[GenerationOperation, _ <: Case]

Attributes

Inherited from:
GenerationSupport (hidden)