doc / ch.tutteli.atrium.api.cc.en_UK / objects

objects

fun <E, T : Iterable<E>> IterableContainsCheckerBuilder<E, T, IterableContainsInAnyOrderSearchBehaviour>.objects(expected: E, vararg otherExpected: E): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected object as well as the otherExpected objects shall be searched within the iterable.

Notice, that it does not search for unique matches. Meaning, if the iterable is setOf('a', 'b') and expected is defined as 'a' and one otherExpected is defined as 'a' as well, then both match, even though they match the same entry. Use an option such as atLeast, atMost and exactly to control the number of occurrences you expect.

Meaning you might want to use: contains.inAnyOrder.exactly(2).objects('a') instead of: contains.inAnyOrder.atLeast(1).objects('a', 'a')

Parameters

expected - The object which is expected to be contained within the Iterable. otherExpected - Additional objects which are expected to be contained within Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInAnyOrderOnlySearchBehaviour>.objects(expected: E, vararg otherExpected: E): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected object as well as the otherExpected objects need to be contained in Iterable where it does not matter in which order.

Parameters

expected - The value which is expected to be contained within the Iterable. otherExpected - Additional values which are expected to be contained within Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.

fun <E, T : Iterable<E>> IterableContainsBuilder<E, T, IterableContainsInOrderOnlySearchBehaviour>.objects(expected: E, vararg otherExpected: E): AssertionPlant<T>

Finishes the specification of the sophisticated contains assertion where the expected object as well as the otherExpected objects need to be contained in Iterable in the specified order.

Parameters

expected - The value which is expected to be contained within the Iterable. otherExpected - Additional values which are expected to be contained within Iterable.

Exceptions

AssertionError - Might throw an AssertionError if the assertion made is not correct.

Return
The AssertionPlant for which the assertion was built to support a fluent API.