Skip to content

Commit 707d8e4

Browse files
committed
Add testcase with negative size value
1 parent 065e7e4 commit 707d8e4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/test/java/io/github/dgroup/enumerable4j/AfterTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.llorllale.cactoos.matchers.Assertion;
3131
import org.llorllale.cactoos.matchers.HasSize;
3232
import org.llorllale.cactoos.matchers.HasValues;
33+
import org.llorllale.cactoos.matchers.Throws;
3334

3435
/**
3536
* Test cases for {@link Enumerable#after}.
@@ -140,4 +141,13 @@ void nullPredicateAndZeroSize() {
140141
).affirm();
141142
}
142143

144+
@Test
145+
void throwExceptionOnNegativeSize() {
146+
new Assertion<>(
147+
"Must throw IllegalArgumentException if the size value is negative",
148+
() -> new Linked<>(1, 2, 3).after(null, -1),
149+
new Throws<>("-1", IllegalArgumentException.class)
150+
).affirm();
151+
}
152+
143153
}

0 commit comments

Comments
 (0)