doc / ch.tutteli.atrium.api.fluent.en_GB

Package ch.tutteli.atrium.api.fluent.en_GB

Contains API which provides a pure fluent API in English and which has its design focus on usability in conjunction with code completion.

Types

Entries

class Entries<T : Any> : GroupWithoutNullableEntries<(Expect<T>.() -> Unit)?>, GroupWithNullableEntries<(Expect<T>.() -> Unit)?>, VarArgHelper<(Expect<T>.() -> Unit)?>

Parameter object to express a Group of identification lambdas.

Entry

class Entry<T : Any> : GroupWithoutNullableEntries<(Expect<T>.() -> Unit)?>, GroupWithNullableEntries<(Expect<T>.() -> Unit)?>

Parameter object to express a Group with a single identification lambda.

KeyValue

data class KeyValue<out K, V : Any>

Parameter object to express a key/value Pair whose value type is a nullable lambda with an Expect receiver, which means one can either pass a lambda or null.

Value

data class Value<out T> : GroupWithNullableEntries<T>, GroupWithoutNullableEntries<T>

Represents a Group with a single value.

Values

class Values<out T> : GroupWithoutNullableEntries<T>, GroupWithNullableEntries<T>, VarArgHelper<T>

Represents a Group of multiple values.

Annotations

ExperimentalWithOptions

annotation class ExperimentalWithOptions

Properties

and

val <T> Expect<T>.and: Expect<T>

Can be used to separate single assertions.

contains

val <T : CharSequence> Expect<T>.contains: CharSequenceContains.Builder<T, NoOpSearchBehaviour>

Creates a CharSequenceContains.Builder based on this Expect which allows to define more sophisticated contains assertions.

containsNot

val <T : CharSequence> Expect<T>.containsNot: NotCheckerOption<T, NotSearchBehaviour>

Creates a CharSequenceContains.Builder based on this Expect which allows to define more sophisticated contains not assertions.

first

val <K, T : Pair<K, *>> Expect<T>.first: Expect<K>

Creates an Expect for the property Pair.first of the subject of the assertion, so that further fluent calls are assertions about it.

grouped

val <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.grouped: IterableContains.Builder<E, T, InOrderOnlyGroupedSearchBehaviour>

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

ignoringCase

val <T : CharSequence> CharSequenceContains.Builder<T, NoOpSearchBehaviour>.ignoringCase: CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>

Defines that the v behaviour ignore case shall be applied to this sophisticated contains assertion.

val <T : CharSequence> NotCheckerOption<T, NotSearchBehaviour>.ignoringCase: NotCheckerOption<T, IgnoringCaseSearchBehaviour>

Defines that the search behaviour ignore case shall be applied to this sophisticated contains not assertion.

inAnyOrder

val <E, T : Iterable<E>> IterableContains.Builder<E, T, NoOpSearchBehaviour>.inAnyOrder: IterableContains.Builder<E, T, InAnyOrderSearchBehaviour>

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

inOrder

val <E, T : Iterable<E>> IterableContains.Builder<E, T, NoOpSearchBehaviour>.inOrder: IterableContains.Builder<E, T, InOrderSearchBehaviour>

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

key

val <K, T : Entry<K, *>> Expect<T>.key: Expect<K>

Creates an Expect for the property Map.Entry.key of the subject of the assertion, so that further fluent calls are assertions about it.

keys

val <K, T : Map<out K, *>> Expect<T>.keys: Expect<Set<K>>

Creates an Expect for the property Map.keys of the subject of the assertion, so that further fluent calls are assertions about it.

message

val <T : Throwable> Expect<T>.message: Expect<String>

Expects that the property Throwable.message of the subject of the assertion is not null, creates an Expect for it and returns it.

only

val <E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderSearchBehaviour>.only: IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>

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

val <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderSearchBehaviour>.only: IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>

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

second

val <V, T : Pair<*, V>> Expect<T>.second: Expect<V>

Creates an Expect for the property Pair.second of the subject of the assertion, so that further fluent calls are assertions about it.

size

val <T : Collection<*>> Expect<T>.size: Expect<Int>

Creates an Expect for the property Collection.size of the subject of the assertion, so that further fluent calls are assertions about it.

value

val <V, T : Entry<*, V>> Expect<T>.value: Expect<V>

Creates an Expect for the property Map.Entry.value of the subject of the assertion, so that further fluent calls are assertions about it.

values

val <V, T : Map<*, V>> Expect<T>.values: Expect<Collection<V>>

Creates an Expect for the property Map.values of the subject of the assertion, so that further fluent calls are assertions about it.

within

val <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlyGroupedSearchBehaviour>.within: IterableContains.Builder<E, T, InOrderOnlyGroupedWithinSearchBehaviour>

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

Functions

all

fun <E : Any, T : Iterable<E?>> Expect<T>.all(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) has at least one element and that every element holds all assertions created by the assertionCreatorOrNull or that all elements are null in case assertionCreatorOrNull is defined as null.

and

infix fun <T> Expect<T>.and(assertionCreator: Expect<T>.() -> Unit): Expect<T>

Can be used to create a group of sub assertions when using the fluent API.

any

fun <E : Any, T : Iterable<E?>> Expect<T>.any(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) contains an entry holding the assertions created by assertionCreatorOrNull or an entry which is null in case assertionCreatorOrNull is defined as null.

asEntries

fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(): Expect<Set<Entry<K, V>>>

Turns Expect<Map<K, V>> into Expect<Set<Map.Entry<K, V>>>.

fun <K, V, T : Map<out K, V>> Expect<T>.asEntries(assertionCreator: Expect<Set<Entry<K, V>>>.() -> Unit): Expect<T>

Turns Expect<Map<K, V>> into Expect<Set<Map.Entry<K, V>>> and expects that it holds all assertions the given assertionCreator creates for it.

asIterable

fun <E, T : Sequence<E>> Expect<T>.asIterable(): Expect<Iterable<E>>

Turns Expect<Sequence<E>> into Expect<Iterable<E>>.

fun <E, T : Sequence<E>> Expect<T>.asIterable(assertionCreator: Expect<Iterable<E>>.() -> Unit): Expect<T>

Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as Iterable.

asList

fun <E> Expect<out Array<out E>>.asList(): Expect<List<E>>

Turns Expect<Array<E>> into Expect<List<E>>.

fun <E> Expect<Array<E>>.asList(assertionCreator: Expect<List<E>>.() -> Unit): Expect<Array<E>>
fun Expect<ByteArray>.asList(assertionCreator: Expect<List<Byte>>.() -> Unit): Expect<ByteArray>
fun Expect<CharArray>.asList(assertionCreator: Expect<List<Char>>.() -> Unit): Expect<CharArray>
fun Expect<ShortArray>.asList(assertionCreator: Expect<List<Short>>.() -> Unit): Expect<ShortArray>
fun Expect<IntArray>.asList(assertionCreator: Expect<List<Int>>.() -> Unit): Expect<IntArray>
fun Expect<LongArray>.asList(assertionCreator: Expect<List<Long>>.() -> Unit): Expect<LongArray>
fun Expect<FloatArray>.asList(assertionCreator: Expect<List<Float>>.() -> Unit): Expect<FloatArray>
fun Expect<DoubleArray>.asList(assertionCreator: Expect<List<Double>>.() -> Unit): Expect<DoubleArray>
fun Expect<BooleanArray>.asList(assertionCreator: Expect<List<Boolean>>.() -> Unit): Expect<BooleanArray>

Expects that the subject of the assertion holds all assertions the given assertionCreator creates for the subject as List.

fun Expect<ByteArray>.asList(): Expect<List<Byte>>

Turns Expect<CharArray> into Expect<List<Byte>>.

fun Expect<CharArray>.asList(): Expect<List<Char>>

Turns Expect<CharArray> into Expect<List<Char>>.

fun Expect<ShortArray>.asList(): Expect<List<Short>>

Turns Expect<ShortArray> into Expect<List<Short>>.

fun Expect<IntArray>.asList(): Expect<List<Int>>

Turns Expect<IntArray> into Expect<List<Int>>.

fun Expect<LongArray>.asList(): Expect<List<Long>>

Turns Expect<LongArray> into Expect<List<Double>>.

fun Expect<FloatArray>.asList(): Expect<List<Float>>

Turns Expect<FloatArray> into Expect<List<Float>>.

fun Expect<DoubleArray>.asList(): Expect<List<Double>>

Turns Expect<DoubleArray> into Expect<List<Double>>.

fun Expect<BooleanArray>.asList(): Expect<List<Boolean>>

Turns Expect<BooleanArray> into Expect<List<Boolean>>.

atLeast

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.Builder<T, S>.atLeast(times: Int): AtLeastCheckerOption<T, S>

Restricts a contains assertion by specifying that the number of occurrences of the value which we are looking for occurs at least number of times within the search input.

fun <E, T : Iterable<E>, S : InAnyOrderSearchBehaviour> IterableContains.Builder<E, T, S>.atLeast(times: Int): AtLeastCheckerOption<E, T, S>

Restricts a contains assertion by specifying that the number of occurrences of the entry which we are looking for occurs at least number of times within the Iterable.

atMost

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.Builder<T, S>.atMost(times: Int): AtMostCheckerOption<T, S>

Restricts a contains assertion by specifying that the number of occurrences of the value which we are looking for occurs at least once but at most number of times within the search input.

fun <E, T : Iterable<E>, S : InAnyOrderSearchBehaviour> IterableContains.Builder<E, T, S>.atMost(times: Int): AtMostCheckerOption<E, T, S>

Restricts a contains assertion by specifying that the number of occurrences of the entry which we are looking for occurs at least once but at most number of times within the Iterable.

butAtMost

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> AtLeastCheckerOption<T, S>.butAtMost(times: Int): ButAtMostCheckerOption<T, S>

Restricts a contains at least assertion by specifying that the number of occurrences of the value which we are looking for occurs at most number of times within the search input.

fun <E, T : Iterable<E>, S : InAnyOrderSearchBehaviour> AtLeastCheckerOption<E, T, S>.butAtMost(times: Int): ButAtMostCheckerOption<E, T, S>

Restricts a contains at least assertion by specifying that the number of occurrences of the entry which we are looking for occurs at most number of times within the Iterable.

cause

fun <TExpected : Throwable> Expect<out Throwable>.cause(): Expect<TExpected>

Expects that the property Throwable.cause of the subject is a TExpected (the same type or a sub-type), creates an Expect of the TExpected type for it and returns it.

fun <TExpected : Throwable> Expect<out Throwable>.cause(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>

Expects that the property Throwable.cause of the subject is a TExpected (the same type or a sub-type) and holds all assertions the given assertionCreator creates for it and returns this assertion container.

contains

fun <T : CharSequence> Expect<T>.contains(expected: Any, vararg otherExpected: Any): Expect<T>

Expects that the subject of the assertion (a CharSequence) contains expected's toString representation and the toString representation of the otherExpected (if given), using a non disjoint search.

fun <E, T : Iterable<E>> Expect<T>.contains(expected: E, vararg otherExpected: E): Expect<T>

Expects that the subject of the assertion (an Iterable) contains the expected value and the otherExpected values (if given).

fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) contains an entry holding the assertions created by assertionCreatorOrNull or an entry which is null in case assertionCreatorOrNull is defined as null.

fun <E : Any, T : Iterable<E?>> Expect<T>.contains(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) contains an entry holding the assertions created by assertionCreatorOrNull or an entry which is null in case assertionCreatorOrNull is defined as null -- likewise an entry (can be the same) is searched for each of the otherAssertionCreatorsOrNulls.

fun <K, V, T : Map<out K, V>> Expect<T>.contains(keyValuePair: Pair<K, V>, vararg otherPairs: Pair<K, V>): Expect<T>

Expects that the subject of the assertion (a Map) contains a key as defined by keyValuePair's Pair.first with a corresponding value as defined by keyValuePair's Pair.second -- optionally the same assertions are created for the otherPairs.

fun <K, V : Any, T : Map<out K, V?>> Expect<T>.contains(keyValue: KeyValue<K, V>, vararg otherKeyValues: KeyValue<K, V>): Expect<T>

Expects that the subject of the assertion (a Map) contains a key as defined by keyValue's KeyValue.key with a corresponding value which either holds all assertions keyValue's KeyValue.valueAssertionCreatorOrNull creates or needs to be null in case KeyValue.valueAssertionCreatorOrNull is defined as null -- optionally the same assertions are created for the otherKeyValues.

containsElementsOf

fun <E, T : Iterable<E>> Expect<T>.containsElementsOf(expectedIterable: Iterable<E>): Expect<T>

Expects that the subject of the assertion (an Iterable) contains all elements of expectedIterable.

containsExactly

fun <E, T : Iterable<E>> Expect<T>.containsExactly(expected: E, vararg otherExpected: E): Expect<T>

Expects that the subject of the assertion (an Iterable) contains only the expected value and the otherExpected values (if given) in the defined order.

fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) contains only an entry holding the assertions created by assertionCreatorOrNull or only one entry which is null in case assertionCreatorOrNull is defined as null.

fun <E : Any, T : Iterable<E?>> Expect<T>.containsExactly(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) contains only an entry holding the assertions created by assertionCreatorOrNull or null in case assertionCreatorOrNull is defined as null and likewise an additional entry for each otherAssertionCreatorsOrNulls (if given) whereas the entries have to appear in the defined order.

containsExactlyElementsOf

fun <E, T : Iterable<E>> Expect<T>.containsExactlyElementsOf(expectedIterable: Iterable<E>): Expect<T>

Expects that the subject of the assertion (an Iterable) contains only elements of expectedIterable in same order

containsKey

fun <K, T : Map<out K, *>> Expect<T>.containsKey(key: K): Expect<T>

Expects that the subject of the assertion (a Map) contains the given key.

containsNot

fun <T : CharSequence> Expect<T>.containsNot(expected: Any, vararg otherExpected: Any): Expect<T>

Expects that the subject of the assertion (a CharSequence) does not contain expected's toString representation and neither one of the otherExpected's toString representation (if given).

fun <E, T : Iterable<E>> Expect<T>.containsNot(expected: E, vararg otherExpected: E): Expect<T>

Expects that the subject of the assertion (an Iterable) does not contain the expected value and neither one of the otherExpected values (if given).

containsNotKey

fun <K, T : Map<out K, *>> Expect<T>.containsNotKey(key: K): Expect<T>

Expects that the subject of the assertion (a Map) does not contain the given key.

containsRegex

fun <T : CharSequence> Expect<T>.containsRegex(pattern: String, vararg otherPatterns: String): Expect<T>
fun <T : CharSequence> Expect<T>.containsRegex(pattern: Regex, vararg otherPatterns: Regex): Expect<T>

Expects that the subject of the assertion (a CharSequence) contains a sequence which matches the given regular expression pattern as well as the otherPatterns (if given), using a non disjoint search.

elementsOf

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.elementsOf(expectedIterable: Iterable<Any>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched, using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterable: Iterable<Any>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched (ignoring case), using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.elementsOf(expectedIterable: Iterable<Any>): Expect<T>fun <E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched within the Iterable.

fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements in expectedIterable need to be contained in Iterable where it does not matter in which order but only as many entries should be returned by the Iterable as values defined.

fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.elementsOf(expectedIterable: Iterable<E>): Expect<T>

Finishes the specification of the sophisticated contains assertion where all elements of the expectedIterable shall be searched within the Iterable (if given) in the specified order.

endsNotWith

fun <T : CharSequence> Expect<T>.endsNotWith(expected: CharSequence): Expect<T>
fun <T : CharSequence> Expect<T>.endsNotWith(expected: Char): Expect<T>

Expects that the subject of the assertion (a CharSequence) does not end with expected.

endsWith

fun <T : CharSequence> Expect<T>.endsWith(expected: CharSequence): Expect<T>
fun <T : CharSequence> Expect<T>.endsWith(expected: Char): Expect<T>

Expects that the subject of the assertion (a CharSequence) ends with expected.

entries

fun <E : Any, T : Iterable<E?>> IterableContains.CheckerOption<E?, T, InAnyOrderSearchBehaviour>.entries(assertionCreatorOrNull: (Expect<E>.() -> Unit)?, vararg otherAssertionCreatorsOrNulls: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where an entry shall be searched which either holds all assertions assertionCreatorOrNull creates or needs to be null in case assertionCreatorOrNull is defined as null -- likewise an entry (can be the same) is searched for each of the otherAssertionCreatorsOrNulls.

fun <E : Any, T : Iterable<E?>> IterableContains.Builder<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 Iterable 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 Iterable where it does not matter in which order the entries appear but only as many entries should be returned by the Iterable as assertion creators are defined.

fun <E : Any, T : Iterable<E?>> IterableContains.Builder<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 Iterable 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 : Iterable<E?>> IterableContains.CheckerOption<E?, T, InAnyOrderSearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where an entry shall be searched which either holds all assertions assertionCreatorOrNull creates or needs to be null in case assertionCreatorOrNull is defined as null.

fun <E : Any, T : Iterable<E?>> IterableContains.Builder<E?, T, InAnyOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the Iterable 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 : Iterable<E?>> IterableContains.Builder<E?, T, InOrderOnlySearchBehaviour>.entry(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Finishes the specification of the sophisticated contains assertion where the Iterable 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.

exactly

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.Builder<T, S>.exactly(times: Int): ExactlyCheckerOption<T, S>

Restricts a contains assertion by specifying that the number of occurrences of the value which we are looking for occurs exactly number of times within the search input.

fun <E, T : Iterable<E>, S : InAnyOrderSearchBehaviour> IterableContains.Builder<E, T, S>.exactly(times: Int): ExactlyCheckerOption<E, T, S>

Restricts a contains assertion by specifying that the number of occurrences of the entry which we are looking for occurs exactly number of times within the Iterable.

feature

fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>): FeatureExpect<T, R>

Extracts the property out of the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, R> Expect<T>.feature(property: KProperty1<in T, R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the property out of the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, R> Expect<T>.feature(f: KFunction1<T, R>): FeatureExpect<T, R>

Extracts the value which is returned when calling f on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, R> Expect<T>.feature(f: KFunction1<T, R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, A1, R> Expect<T>.feature(f: KFunction2<T, A1, R>, a1: A1): FeatureExpect<T, R>

Extracts the value which is returned when calling f with argument a1 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, A1, R> Expect<T>.feature(f: KFunction2<T, A1, R>, a1: A1, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f with argument a1 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, A1, A2, R> Expect<T>.feature(f: KFunction3<T, A1, A2, R>, a1: A1, a2: A2): FeatureExpect<T, R>

Extracts the value which is returned when calling f with arguments a1, a2 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, A1, A2, R> Expect<T>.feature(f: KFunction3<T, A1, A2, R>, a1: A1, a2: A2, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f with argument a1, a2 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, A1, A2, A3, R> Expect<T>.feature(f: KFunction4<T, A1, A2, A3, R>, a1: A1, a2: A2, a3: A3): FeatureExpect<T, R>

Extracts the value which is returned when calling f with arguments a1, a2, a3 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, A1, A2, A3, R> Expect<T>.feature(f: KFunction4<T, A1, A2, A3, R>, a1: A1, a2: A2, a3: A3, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f with argument a1, a2, a3 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, A1, A2, A3, A4, R> Expect<T>.feature(f: KFunction5<T, A1, A2, A3, A4, R>, a1: A1, a2: A2, a3: A3, a4: A4): FeatureExpect<T, R>

Extracts the value which is returned when calling f with arguments a1, a2, a3, a4 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, A1, A2, A3, A4, R> Expect<T>.feature(f: KFunction5<T, A1, A2, A3, A4, R>, a1: A1, a2: A2, a3: A3, a4: A4, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f with argument a1, a2, a3, a4 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, A1, A2, A3, A4, A5, R> Expect<T>.feature(f: KFunction6<T, A1, A2, A3, A4, A5, R>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5): FeatureExpect<T, R>

Extracts the value which is returned when calling f with arguments a1, a2, a3, a4, a5 on the current subject of the assertion, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, A1, A2, A3, A4, A5, R> Expect<T>.feature(f: KFunction6<T, A1, A2, A3, A4, A5, R>, a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts the value which is returned when calling f with argument a1, a2, a3, a4, a5 on the current subject of the assertion, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, R> Expect<T>.feature(description: String, provider: T.() -> R): FeatureExpect<T, R>

Extracts a feature out of the current subject of the assertion based on the given provider and using the given description, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, R> Expect<T>.feature(description: String, provider: T.() -> R, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts a feature out of the current subject of the assertion based on the given provider and using the given description, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>): FeatureExpect<T, R>

Extracts a feature out of the current subject of the assertion, based on the given provider, creates a new Expect for it and returns it so that subsequent calls are based on the feature.

fun <T, R> Expect<T>.feature(provider: MetaFeatureOption<T>.(T) -> MetaFeature<R>, assertionCreator: Expect<R>.() -> Unit): Expect<T>

Extracts a feature out of the current subject of the assertion, based on the given provider, creates a new Expect for it, applies an assertion group based on the given assertionCreator for the feature and returns the initial Expect with the current subject.

first

fun <K, V, T : Pair<K, V>> Expect<T>.first(assertionCreator: Expect<K>.() -> Unit): Expect<T>

Expects that the property Pair.first of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

get

fun <E, T : List<E>> Expect<T>.get(index: Int): Expect<E>

Expects that the given index is within the bounds of the subject of the assertion (a List) and returns an Expect for the element at that position.

fun <E, T : List<E>> Expect<T>.get(index: Int, assertionCreator: Expect<E>.() -> Unit): Expect<T>

Expects that the given index is within the bounds of the subject of the assertion (a List) and that the element at that position holds all assertions the given assertionCreator creates for it.

getExisting

fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K): Expect<V>

Expects that the subject of the assertion (a Map) contains the given key, creates an Expect for the corresponding value and returns the newly created assertion container, so that further fluent calls are assertions about it.

fun <K, V, T : Map<out K, V>> Expect<T>.getExisting(key: K, assertionCreator: Expect<V>.() -> Unit): Expect<T>

Expects that the subject of the assertion (a Map) contains the given key and that the corresponding value holds all assertions the given assertionCreator creates for it.

hasNext

fun <E, T : Iterable<E>> Expect<T>.hasNext(): Expect<T>

Expects that the subject of the assertion (an Iterable) has at least one element.

hasNotNext

fun <E, T : Iterable<E>> Expect<T>.hasNotNext(): Expect<T>

Expects that the subject of the assertion (an Iterable) does not have next element.

hasSize

fun <T : Collection<*>> Expect<T>.hasSize(expected: Int): Expect<T>

Expects that the subject of the assertion (a Collection) has the given expected size.

inAnyOrder

fun <E, T : Iterable<E>> IterableContains.Builder<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 Iterable as only elements and in the specified order whereas the values within the groups can occur in any order.

fun <E : Any, T : Iterable<E?>> IterableContains.Builder<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 Iterable as only elements and in the specified order whereas the identification lambdas within the groups can occur in any order.

isA

fun <TSub : Any> Expect<*>.isA(): Expect<TSub>

Expects that the subject of the assertion is a TSub (the same type or a sub-type) and changes the subject to this type.

fun <TSub : Any> Expect<*>.isA(assertionCreator: Expect<TSub>.() -> Unit): Expect<TSub>

Expects that the subject of the assertion is a TSub (the same type or a sub-type) and that it holds all assertions the given assertionCreator creates.

isEmpty

fun <T : CharSequence> Expect<T>.isEmpty(): Expect<T>

Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isEmpty.

isEqualIncludingScale

fun <T : BigDecimal> Expect<T>.isEqualIncludingScale(expected: T): Expect<T>

Expects that the subject of the assertion (a BigDecimal) is equal to expected including BigDecimal.scale.

isGreaterThan

fun <T : Comparable<T>> Expect<T>.isGreaterThan(expected: T): Expect<T>

Expects that the subject of the assertion is greater than expected. The comparison is carried out with Comparable.compareTo.

isGreaterThanOrEqual

fun <T : Comparable<T>> Expect<T>.isGreaterThanOrEqual(expected: T): Expect<T>

Expects that the subject of the assertion is greater than or equal expected. The comparison is carried out with Comparable.compareTo.

isKeyValue

fun <K, V, T : Entry<K, V>> Expect<T>.isKeyValue(key: K, value: V): Expect<T>

Expects that the property Map.Entry.key of the subject of the assertion is equal to the given key and the property Map.Entry.value is equal to the given value.

isLessThan

fun <T : Comparable<T>> Expect<T>.isLessThan(expected: T): Expect<T>

Expects that the subject of the assertion is less than expected. The comparison is carried out with Comparable.compareTo.

isLessThanOrEqual

fun <T : Comparable<T>> Expect<T>.isLessThanOrEqual(expected: T): Expect<T>

Expects that the subject of the assertion is less than or equal expected. The comparison is carried out with Comparable.compareTo.

isNotBlank

fun <T : CharSequence> Expect<T>.isNotBlank(): Expect<T>

Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotBlank.

isNotEmpty

fun <T : CharSequence> Expect<T>.isNotEmpty(): Expect<T>

Expects that the subject of the assertion (a CharSequence) CharSequence.kotlin.text.isNotEmpty.

isNotEqualIncludingScale

fun <T : BigDecimal> Expect<T>.isNotEqualIncludingScale(expected: T): Expect<T>

Expects that the subject of the assertion (a BigDecimal) is not equal to expected including BigDecimal.scale.

isNotNumericallyEqualTo

fun <T : BigDecimal> Expect<T>.isNotNumericallyEqualTo(expected: T): Expect<T>

Expects that the subject of the assertion (a BigDecimal) is not numerically equal to expected.

isNotSameAs

fun <T> Expect<T>.isNotSameAs(expected: T): Expect<T>

Expects that the subject of the assertion is not the same instance as expected.

isNumericallyEqualTo

fun <T : BigDecimal> Expect<T>.isNumericallyEqualTo(expected: T): Expect<T>

Expects that the subject of the assertion (a BigDecimal) is numerically equal to expected.

isSameAs

fun <T> Expect<T>.isSameAs(expected: T): Expect<T>

Expects that the subject of the assertion is the same instance as expected.

key

fun <K, V, T : Entry<K, V>> Expect<T>.key(assertionCreator: Expect<K>.() -> Unit): Expect<T>

Expects that the property Map.Entry.key of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

keys

fun <K, V, T : Map<out K, V>> Expect<T>.keys(assertionCreator: Expect<Set<K>>.() -> Unit): Expect<T>

Expects that the property Map.keys of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

matches

fun <T : CharSequence> Expect<T>.matches(expected: Regex): Expect<T>

Expects that the subject of the assertion (a CharSequence) matches the given expected.

max

fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(): Expect<E>

Creates an Expect for the result of calling max() on the subject of the assertion, so that further fluent calls are assertions about it.

fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.max(assertionCreator: Expect<E>.() -> Unit): Expect<T>

Expects that the result of calling max() on the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

message

fun <T : Throwable> Expect<T>.message(assertionCreator: Expect<String>.() -> Unit): Expect<T>

Expects that the property Throwable.message of the subject of the assertion is not null and holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

messageContains

fun <T : Throwable> Expect<T>.messageContains(expected: Any, vararg otherExpected: Any): Expect<T>

Expects that the property Throwable.message of the subject of the assertion is not null and contains expected's toString representation and the toString representation of the otherExpected (if given), using a non disjoint search.

min

fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(): Expect<E>

Creates an Expect for the result of calling min() on the subject of the assertion, so that further fluent calls are assertions about it.

fun <E : Comparable<E>, T : Iterable<E>> Expect<T>.min(assertionCreator: Expect<E>.() -> Unit): Expect<T>

Expects that the result of calling min() on the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

mismatches

fun <T : CharSequence> Expect<T>.mismatches(expected: Regex): Expect<T>

Expects that the subject of the assertion (a CharSequence) mismatches the given expected.

none

fun <E : Any, T : Iterable<E?>> Expect<T>.none(assertionCreatorOrNull: (Expect<E>.() -> Unit)?): Expect<T>

Expects that the subject of the assertion (an Iterable) does not contain a single entry which holds all assertions created by assertionCreatorOrNull or does not contain a single entry which is null in case assertionCreatorOrNull is defined as null.

notOrAtMost

fun <T : CharSequence, S : CharSequenceContains.SearchBehaviour> CharSequenceContains.Builder<T, S>.notOrAtMost(times: Int): NotOrAtMostCheckerOption<T, S>

Restricts a contains assertion by specifying that the number of occurrences of the value which we are looking for occurs not at all or at most number of times within the search input.

fun <E, T : Iterable<E>, S : InAnyOrderSearchBehaviour> IterableContains.Builder<E, T, S>.notOrAtMost(times: Int): NotOrAtMostCheckerOption<E, T, S>

Restricts a contains assertion by specifying that the number of occurrences of the entry which we are looking for occurs not at all or at most number of times within the Iterable.

notToBe

fun <T> Expect<T>.notToBe(expected: T): Expect<T>

Expects that the subject of the assertion is not (equal to) expected.

notToBeNull

fun <T : Any> Expect<T?>.notToBeNull(): Expect<T>

Expects that the subject of the assertion is not null and changes the subject to the non-nullable version.

fun <T : Any> Expect<T?>.notToBeNull(assertionCreator: Expect<T>.() -> Unit): Expect<T>

Expects that the subject of the assertion is not null and that it holds all assertions the given assertionCreator creates.

notToThrow

fun <R, T : () -> R> Expect<T>.notToThrow(): Expect<R>

Expects that no Throwable is thrown at all when calling the subject (a lambda with arity 0, i.e. without arguments) and changes the subject of the assertion to the return value of type R.

fun <R, T : () -> R> Expect<T>.notToThrow(assertionCreator: Expect<R>.() -> Unit): Expect<R>

Expects that no Throwable is thrown at all when calling the subject (a lambda with arity 0, i.e. without arguments) and that the corresponding return value holds all assertions the given assertionCreator creates.

regex

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.regex(pattern: String, vararg otherPatterns: String): Expect<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression pattern as well as the otherPatterns are expected to have a match, using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.regex(pattern: Regex, vararg otherPatterns: Regex): Expect<T>

Finishes the specification of the sophisticated contains assertion where the given Regex as well as the otherPatterns are expected to have a match, using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.regex(pattern: String, vararg otherPatterns: String): Expect<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression pattern as well as the otherPatterns are expected to have a match (ignoring case), using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.regex(pattern: String, vararg otherPatterns: String): Expect<T>

Finishes the specification of the sophisticated contains assertion where the given regular expression pattern as well as the otherPatterns are expected to to have at least one match (ignoring case), using a non disjoint search.

second

fun <K, V, T : Pair<K, V>> Expect<T>.second(assertionCreator: Expect<V>.() -> Unit): Expect<T>

Expects that the property Pair.second of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

size

fun <E, T : Collection<E>> Expect<T>.size(assertionCreator: Expect<Int>.() -> Unit): Expect<T>

Expects that the property Collection.size of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

startsNotWith

fun <T : CharSequence> Expect<T>.startsNotWith(expected: CharSequence): Expect<T>
fun <T : CharSequence> Expect<T>.startsNotWith(expected: Char): Expect<T>

Expects that the subject of the assertion (a CharSequence) does not start with expected.

startsWith

fun <T : CharSequence> Expect<T>.startsWith(expected: CharSequence): Expect<T>
fun <T : CharSequence> Expect<T>.startsWith(expected: Char): Expect<T>

Expects that the subject of the assertion (a CharSequence) starts with expected.

toBe

fun <T> Expect<T>.toBe(expected: T): Expect<T>

Expects that the subject of the assertion is (equal to) expected.

fun <T : BigDecimal> Expect<T?>.toBe(expected: Nothing?): Expect<T?>

Expects that the subject of the assertion (a BigDecimal) is null.

toBeNullIfNullGivenElse

fun <T : Any> Expect<T?>.toBeNullIfNullGivenElse(assertionCreatorOrNull: (Expect<T>.() -> Unit)?): Expect<T?>

Expects that the subject of the assertion is either null in case assertionCreatorOrNull is null or is not null and holds all assertions assertionCreatorOrNull creates.

toBeWithErrorTolerance

fun Expect<Float>.toBeWithErrorTolerance(expected: Float, tolerance: Float): Expect<Float>

Expects that the subject of the assertion (a Float) is equal to expected with an error tolerance (range including bounds).

fun Expect<Double>.toBeWithErrorTolerance(expected: Double, tolerance: Double): Expect<Double>

Expects that the subject of the assertion (a Double) is equal to expected with an error tolerance (range including bounds).

fun <T : BigDecimal> Expect<T>.toBeWithErrorTolerance(expected: BigDecimal, tolerance: BigDecimal): Expect<T>

Expects that the subject of the assertion is equal to expected with an error tolerance (range including bounds).

toThrow

fun <TExpected : Throwable> Expect<() -> Any?>.toThrow(): Expect<TExpected>

Expects that the thrown Throwable is a TExpected (the same type or a sub-type).

fun <TExpected : Throwable> Expect<() -> Any?>.toThrow(assertionCreator: Expect<TExpected>.() -> Unit): Expect<TExpected>

Expects that the thrown Throwable is a TExpected (the same type or a sub-type) and that it holds all assertions the given assertionCreator creates.

value

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.value(expected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected object shall be searched, using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.value(expected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value shall be searched (ignoring case), using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.value(expected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value shall be searched (ignoring case), using a non disjoint search where it needs to be contained at least once.

fun <E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.value(expected: E): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value shall be searched within the Iterable.

fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InAnyOrderOnlySearchBehaviour>.value(expected: E): Expect<T>
fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.value(expected: E): Expect<T>

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

fun <K, V, T : Entry<K, V>> Expect<T>.value(assertionCreator: Expect<V>.() -> Unit): Expect<T>

Expects that the property Map.Entry.value of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

values

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, NoOpSearchBehaviour>.values(expected: Any, vararg otherExpected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value as well as the otherExpected values shall be searched, using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.CheckerOption<T, IgnoringCaseSearchBehaviour>.values(expected: Any, vararg otherExpected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value as well as the otherExpected values shall be searched (ignoring case), using a non disjoint search.

fun <T : CharSequence> CharSequenceContains.Builder<T, IgnoringCaseSearchBehaviour>.values(expected: Any, vararg otherExpected: Any): Expect<T>

Finishes the specification of the sophisticated contains assertion where the expected value as well as the otherExpected values shall be searched (ignoring case), using a non disjoint search where each need to be contained at least once.

fun <E, T : Iterable<E>> IterableContains.CheckerOption<E, T, InAnyOrderSearchBehaviour>.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) shall be searched within the Iterable.

fun <E, T : Iterable<E>> IterableContains.Builder<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 Iterable where it does not matter in which order but only as many entries should be returned by the Iterable as values defined.

fun <E, T : Iterable<E>> IterableContains.Builder<E, T, InOrderOnlySearchBehaviour>.values(expected: E, vararg otherExpected: E): Expect<T>

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

fun <K, V, T : Map<K, V>> Expect<T>.values(assertionCreator: Expect<Collection<V>>.() -> Unit): Expect<T>

Expects that the property Map.keys of the subject of the assertion holds all assertions the given assertionCreator creates for it and returns an Expect for the current subject of the assertion.

withOptions

fun <T> RootExpect<T>.withOptions(configuration: ExpectBuilder.OptionsChooser<T>.() -> Unit): Expect<T>
fun <T, R> FeatureExpect<T, R>.withOptions(configuration: FeatureExtractorBuilder.OptionsChooser<R>.() -> Unit): Expect<R>

Uses the given configuration-lambda to create an ExpectOptions which in turn is used to override (parts) of the existing configuration.

fun <T> RootExpect<T>.withOptions(options: ExpectOptions<T>): Expect<T>
fun <T, R> FeatureExpect<T, R>.withOptions(options: FeatureOptions<R>): Expect<R>

Uses the given options to override (parts) of the existing configuration.

withRepresentation

fun <T> RootExpect<T>.withRepresentation(textRepresentation: String): Expect<T>
fun <T, R> FeatureExpect<T, R>.withRepresentation(textRepresentation: String): Expect<R>

Wraps the given textRepresentation into a RawString and uses it as representation of the subject instead of the representation that has been defined so far (which defaults to the subject itself).

fun <T> RootExpect<T>.withRepresentation(representationProvider: (T) -> Any): Expect<T>
fun <T, R> FeatureExpect<T, R>.withRepresentation(representationProvider: (R) -> Any): Expect<R>

Uses the given representationProvider to retrieve a representation which can be based on the current subject where it is used as new representation of the subject instead of the representation that has been defined so far (which defaults to the subject itself).