B2: Tests für remove, auch wenn das bisher noch nicht implementiert ist
This commit is contained in:
parent
b3fb099758
commit
eeb322db2e
@ -1,5 +1,6 @@
|
||||
package xyz.joethei.studium.algodat.vorlesung;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import xyz.joethei.studium.algodat.praktikum.blatt2.List;
|
||||
import xyz.joethei.studium.algodat.praktikum.blatt2.RingList;
|
||||
@ -7,6 +8,7 @@ import xyz.joethei.studium.algodat.praktikum.blatt2.RingList;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class Blatt2Test {
|
||||
|
||||
@ -37,5 +39,17 @@ class Blatt2Test {
|
||||
assertEquals(10, rList.size());
|
||||
}
|
||||
|
||||
@Disabled
|
||||
@Test
|
||||
void remove() {
|
||||
List<Integer> rList = new RingList<>();
|
||||
for (int i = 1; i <= 10; i++) {
|
||||
rList.add(i * i);
|
||||
}
|
||||
assertEquals(Optional.of(36), Optional.ofNullable(rList.remove(5)));
|
||||
assertEquals(9, rList.size());
|
||||
assertTrue(rList.get(5) != 36);
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user