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

notToContain

val <T : CharSequence> Expect<T>.notToContain: NotCheckerStep<T, NotSearchBehaviour> (source)

Starts a sophisticated noToContain assertion building process based on this Expect and already chooses a NotCheckerStep.

expect("ABC").notToContain.value("X")

fails {
    expect("ABC").notToContain.value("B")
}

Return
The newly created builder.

Since
0.17.0

fun <T : CharSequence> Expect<T>.notToContain(expected: CharSequenceOrNumberOrChar, vararg otherExpected: CharSequenceOrNumberOrChar): Expect<T> (source)

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

It is a shortcut for notToContain.values(expected, *otherExpected).

Notice that a runtime check applies which assures that only CharSequence, Number and Char are passed. This function expects CharSequenceOrNumberOrChar (which is a typealias for Any) for your convenience, so that you can mix String and Int for instance.

expect("ABC").notToContain("X")

expect("ABC").notToContain("X", 'Y', 1)

fails {
    expect("ABC").notToContain("B")
}

fails {
    expect("ABC").notToContain("B", "X")
}

Return
an Expect for the subject of this expectation.

Since
0.17.0

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

Expects that the subject of this expectation (an Iterable) has at least one element and that it does not contain the expected value and neither one of the otherExpected values (if given).

It is a shortcut for notToContain.values(expected, *otherExpected)

expect(listOf("A", "B", "C")).notToContain("D", "E")

fails {
    expect(listOf("A", "B", "C")).notToContain("A", "D")
}

Return
an Expect for the subject of this expectation.

Since
0.17.0