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

hasSize

fun <T : Collection<*>> Expect<T>.hasSize(expected: Int): Expect<T> (source)
Deprecated: Use toHaveSize; will be removed with 1.0.0 at the latest

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

Shortcut for size.toEqual(expected).

expect(listOf(1, 2, 3)).hasSize(3)

fails {
    expect(listOf(1, 2, 3)).hasSize(1)
}

Return
an Expect for the subject of this expectation.