BAEL-3323 new check added to example

This commit is contained in:
David Calap 2019-10-02 09:22:55 +02:00
parent 30bf670ba4
commit 0478d46007
1 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package com.baeldung.lists
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertTrue
class ListsUnitTest {
@ -26,7 +27,8 @@ class ListsUnitTest {
fun whenFilterNotWithPredicate_thenMatchingItemsAreReturned() {
//Returns a list containing only elements not matching the given predicate.
val theMehBatmans = batmans.filterNot { actor -> actor.contains("a") }
assertTrue(!theMehBatmans.contains("Christian Bale") && !theMehBatmans.contains("Michael Keaton"))
assertFalse(theMehBatmans.contains("Christian Bale") && theMehBatmans.contains("Michael Keaton"))
assertTrue(theMehBatmans.contains("Ben Affleck") && theMehBatmans.contains("George Clooney"))
}
}