doc / ch.tutteli.atrium.logic.creating.iterable.contains.steps.impl / EntryPointStepImpl

EntryPointStepImpl

class EntryPointStepImpl<E, T, out S : IterableLikeContains.SearchBehaviour> : EntryPointStepImpl<T, S>, IterableLikeContains.EntryPointStepInternal<E, T, S>

Constructors

<init>

EntryPointStepImpl(container: AssertionContainer<T>, converter: (T) -> Iterable<E>, searchBehaviour: S)

Properties

converter

val converter: (T) -> Iterable<E>

The converter which shall be used to turn the subject of the assertion into an Iterable of type E.

Extension Properties

_logic

val <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStep<E, T, S>._logic: IterableLikeContains.EntryPointStepLogic<E, T, S>

Entry point to the logic level of Atrium -- which is one level deeper than the API -- within the building process of a sophisticated contains assertion for Iterable.

andOnly

val <E, T> IterableLikeContains.EntryPointStepLogic<E, T, InOrderSearchBehaviour>.andOnly: IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>

butOnly

val <E, T> IterableLikeContains.EntryPointStepLogic<E, T, InAnyOrderSearchBehaviour>.butOnly: IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>

Extension Functions

_logicAppend

fun <E, T : Any, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStep<E, T, S>._logicAppend(factory: IterableLikeContains.EntryPointStepLogic<E, T, S>.() -> Assertion): Expect<T>

Appends the Assertion the given factory creates based on this IterableLikeContains.EntryPointStep.

and

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderSearchBehaviour>.and(only: only): IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>

Defines that the constraint "only the specified entries exist in the IterableLike" shall be applied to this sophisticated contains in order IterableLike assertion.

atLeastCheckerStep

fun <E, T, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStepLogic<E, T, S>.atLeastCheckerStep(times: Int, nameContainsNotFun: String, atLeastCall: (Int) -> String): AtLeastCheckerStep<E, T, S>

atMostCheckerStep

fun <E, T, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStepLogic<E, T, S>.atMostCheckerStep(times: Int, nameContainsNotFun: String, atMostCall: (Int) -> String, atLeastCall: (Int) -> String, exactlyCall: (Int) -> String): AtMostCheckerStep<E, T, S>

but

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderSearchBehaviour>.but(only: only): IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>

Defines that the constraint "only the specified entries exist in the IterableLike" shall be applied to this sophisticated contains IterableLike assertion.

entries

fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.entries(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where an entry needs to be contained in the IterableLike which holds all assertions assertionCreatorOrNull creates or needs to be null in case assertionCreatorOrNull is defined as null -- likewise an entry for each otherAssertionCreatorsOrNulls needs to be contained in the IterableLike where it does not matter in which order the entries appear but only as many entries should be returned by the IterableLike as assertion creators are defined.

fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlySearchBehaviour>.entries(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only an entry which holds all assertions assertionCreatorOrNull creates or is null in case assertionCreatorOrNull is defined as null and likewise a further entry for each otherAssertionCreatorsOrNulls (if given) whereas the entries have to appear in the specified order.

entry

fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only one entry which holds all assertions created by the given assertionCreatorOrNull or is null in case assertionCreatorOrNull is defined as null.

fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only a single entry which holds all assertions created by the given assertionCreatorOrNull or needs to be null in case assertionCreatorOrNull is defined as null.

entry

infix fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only one entry which holds all assertions created by the given assertionCreatorOrNull or is null in case assertionCreatorOrNull is defined as null.

infix fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only a single entry which holds all assertions created by the given assertionCreatorOrNull or needs to be null in case assertionCreatorOrNull is defined as null.

exactlyCheckerStep

fun <E, T, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStepLogic<E, T, S>.exactlyCheckerStep(times: Int, nameContainsNotFun: String, exactlyCall: (Int) -> String): ExactlyCheckerStep<E, T, S>

grouped

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.grouped(entries: entries): IterableLikeContains.EntryPointStep<E, T, InOrderOnlyGroupedSearchBehaviour>

Defines that the IterableLike contains in order only groups of entries whereas the order within the group is specified as next step.

inAny

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAny(order: Order<E, Group<E>>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected Order.firstGroup as well as the Order.secondGroup and optionally Order.otherExpectedGroups of values need to be contained in IterableLike in the specified order whereas the values within the groups can occur in any order.

infix fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAny(order: Order<(Expect<E>.() -> Unit)?, Group<(Expect<E>.() -> Unit)?>>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected Order.firstGroup as well as the Order.secondGroup and optionally Order.otherExpectedGroups of identification lambdas, identifying an entry, need to be contained in IterableLike in the specified order whereas the identification lambdas within the groups can occur in any order.

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, NoOpSearchBehaviour>.inAny(order: order): IterableLikeContains.EntryPointStep<E, T, InAnyOrderSearchBehaviour>

Defines that the search behaviour "find entries in any order in the IterableLike" shall be applied to this sophisticated contains in IterableLike assertion.

inAnyOrder

fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAnyOrder(firstGroup: Group<E>, secondGroup: Group<E>, vararg otherExpectedGroups: Group<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected firstGroup as well as the secondGroup and optionally otherExpectedGroups of values need to be contained in IterableLike as only elements and in the specified order whereas the values within the groups can occur in any order.

fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlyGroupedWithinSearchBehaviour>.inAnyOrder(firstGroup: Group<(Expect<E>.() -> Unit)?>, secondGroup: Group<(Expect<E>.() -> Unit)?>, vararg otherExpectedGroups: Group<(Expect<E>.() -> Unit)?>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected firstGroup as well as the secondGroup and optionally otherExpectedGroups of identification lambdas, identifying an entry, need to be contained in IterableLike as only elements and in the specified order whereas the identification lambdas within the groups can occur in any order.

inGiven

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, NoOpSearchBehaviour>.inGiven(order: order): IterableLikeContains.EntryPointStep<E, T, InOrderSearchBehaviour>

Defines that the search behaviour "find entries in order in the IterableLike" shall be applied to this sophisticated contains in IterableLike assertion.

notCheckerStep

fun <E, T, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStepLogic<E, T, S>.notCheckerStep(): NotCheckerStep<E, T, S>

notOrAtMostCheckerStep

fun <E, T, S : IterableLikeContains.SearchBehaviour> IterableLikeContains.EntryPointStepLogic<E, T, S>.notOrAtMostCheckerStep(times: Int, nameContainsNotFun: String, notOrAtMostCall: (Int) -> String): NotOrAtMostCheckerStep<E, T, S>

the

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.the(values: Values<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected values must be contained in IterableLike but it does not matter in which order.

infix fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InAnyOrderOnlySearchBehaviour>.the(entries: Entries<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where an entry needs to be contained in the IterableLike which holds all assertions entries.assertionCreatorOrNull creates or it needs to be null in case entries.assertionCreatorOrNull is defined as null -- likewise an entry for each entries.otherAssertionCreatorsOrNulls needs to be contained in the IterableLike where it does not matter in which order the entries appear but only as many entries should be returned by the IterableLike as assertion creators are defined.

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.the(values: Values<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected values in the specified order.

infix fun <E : Any, T> IterableLikeContains.EntryPointStep<out E?, T, InOrderOnlySearchBehaviour>.the(entries: Entries<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only an entry which holds all assertions entries.assertionCreatorOrNull creates or is null in case entries.assertionCreatorOrNull is defined as null and likewise a further entry for each entries.otherAssertionCreatorsOrNulls (if given) whereas the entries have to appear in the specified order.

toVarArg

fun <T> IterableLikeContains.EntryPointStepLogic<*, *, *>.toVarArg(iterableLike: IterableLike): Pair<T, Array<out T>>

Transforms the given IterableLike to Pair<T, Array<out T>> with the intend that it can be easily used for a function requiring T, vararg T

value

fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T>
fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected value.

value

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T>
infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected value.

values

fun <E, T> IterableLikeContains.EntryPointStep<E, T, InAnyOrderOnlySearchBehaviour>.values(expected: E, vararg otherExpected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value as well as the otherExpected values (if given) need to be contained in IterableLike where it does not matter in which order but only as many entries should be returned by the IterableLike as values defined.

fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlySearchBehaviour>.values(expected: E, vararg otherExpected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the IterableLike needs to contain only the expected value as well as the otherExpected values (if given) in the specified order.

within

infix fun <E, T> IterableLikeContains.EntryPointStep<E, T, InOrderOnlyGroupedSearchBehaviour>.within(group: group): IterableLikeContains.EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBehaviour>

A filler word to emphasis that the next step defines the order within expected groups of values.