Skip to content

Commit

Permalink
Add testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
dykov committed Jun 6, 2021
1 parent ce99062 commit 72447a6
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions src/test/java/io/github/dgroup/enumerable4j/ZipTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void nullInResult() {
}

@Test
void nullInArgs() {
void nullFirstArg() {
new Assertion<>(
"A lack of elements is replaced with null",
new Linked<>(1, 2, 3).zip(null, new Linked<>(8)),
Expand All @@ -113,7 +113,7 @@ void nullInArgs() {
}

@Test
void nullInArgCollection() {
void nullInFirstArg() {
new Assertion<>(
"A lack of elements is replaced with null",
new Linked<>(1, 2, 3).zip(new Linked<>(null, null), new Linked<>(8)),
Expand All @@ -126,4 +126,49 @@ void nullInArgCollection() {
)
).affirm();
}

@Test
void nullOtherArgs() {
new Assertion<>(
"A lack of elements is replaced with null",
new Linked<>(1, 2, 3).zip(new Linked<>(4, 5), null),
new HasEqualValues<>(
new Linked<Enumerable<Integer>>(
new Linked<>(1, 4, null),
new Linked<>(2, 5, null),
new Linked<>(3, null, null)
)
)
).affirm();
}

@Test
void nullInOtherArgs() {
new Assertion<>(
"A lack of elements is replaced with null",
new Linked<>(1, 2, 3).zip(new Linked<>(4, 5), new Linked<>(null, null)),
new HasEqualValues<>(
new Linked<Enumerable<Integer>>(
new Linked<>(1, 4, null),
new Linked<>(2, 5, null),
new Linked<>(3, null, null)
)
)
).affirm();
}

@Test
void nullInArgs() {
new Assertion<>(
"A lack of elements is replaced with null",
new Linked<>(1, 2, 3).zip(null, new Linked<>(null, 5), null),
new HasEqualValues<>(
new Linked<Enumerable<Integer>>(
new Linked<>(1, null, null, null),
new Linked<>(2, null, 5, null),
new Linked<>(3, null, null, null)
)
)
).affirm();
}
}

0 comments on commit 72447a6

Please sign in to comment.