doc / ch.tutteli.atrium.api.cc.infix.en_UK / atMost

# atMost

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

(source)

**Deprecated:** Use pendant from package en_GB; will be removed with 1.0.0

Restricts a `contains`

assertion by specifying that the number of occurrences of the object which we
are looking for, occurs `at least`

once but `at most`

number of times within the search input.

If you want to use a higher lower bound than one, then use `atLeast(2).butAtMost(3)`

instead of `atMost(3)`

.
And in case you want to state that it is either not contained at all or at most a certain number of times,
then use `notOrAstMost(2)`

instead.

### Parameters

`times`

- The number which the check will compare against the actual number of times an expected object is
found in the input of the search.

### Exceptions

`IllegalArgumentException`

- In case times is smaller than zero.

`IllegalArgumentException`

- In case times equals to zero; use containsNot instead.

`IllegalArgumentException`

- In case times equals to one; use exactly instead.

**Return**

The newly created builder.

`fun <T : CharSequence, S : SearchBehaviour> `~~atMost~~(builder: CharSequenceContainsBuilder<T, S>, times: Int): CharSequenceContainsAtMostCheckerBuilder<T, S>

(source)

**Deprecated:** Use the extension fun `atMost` instead. This fun is only here to retain binary compatibility; will be removed with 1.0.0

`fun <E, T : Iterable<E>> `~~atMost~~(builder: IterableContainsBuilder<E, T, InAnyOrderSearchBehaviour>, times: Int): IterableContainsAtMostCheckerBuilder<E, T>

(source)

**Deprecated:** Use the extension fun `atMost` instead. This fun is only here to retain binary compatibility; will be removed with 1.0.0

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

(source)

**Deprecated:** Use pendant from package en_GB; will be removed with 1.0.0

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.

If you want to use a higher lower bound than one, then use `atLeast(2).butAtMost(3)`

instead of `atMost(3)`

.
And in case you want to state that it is either not contained at all or at most a certain number of times,
then use `notOrAstMost(2)`

instead.

### Parameters

`times`

- The number which the check will compare against the actual number of times an expected entry is
found in the Iterable.

### Exceptions

`IllegalArgumentException`

- In case times is smaller than zero.

`IllegalArgumentException`

- In case times equals to zero; use containsNot instead.

`IllegalArgumentException`

- In case times equals to one; use exactly instead.

**Return**

The newly created builder.