notToBeEmpty
Expects that the subject of this
expectation (a CharSequence) CharSequence.kotlin.text.isNotEmpty.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Samples
expect("XYZ").notToBeEmpty()
fails {
expect("").notToBeEmpty()
}
// use notToBeBlank to check for whitespaces
expect(" ").notToBeEmpty()
Expects that the subject of this
expectation (a Collection) is not an empty Collection.
Return
an Expect for the subject of this
expectation.
Samples
expect(listOf(1, 2, 3)).notToBeEmpty()
fails {
expect(listOf<Int>()).notToBeEmpty()
}
Expects that the subject of this
expectation (a Map) is not an empty Map.
Return
an Expect for the subject of this
expectation.
Since
0.17.0
Samples
expect(mapOf(1 to "a")).notToBeEmpty()
fails { // because the map is empty
expect(emptyMap<Int, String>()).notToBeEmpty()
}