Skip to content

Commit 9fcf6d0

Browse files
committed
add test case 3
1 parent fbae596 commit 9fcf6d0

File tree

2 files changed

+39
-8
lines changed

2 files changed

+39
-8
lines changed

.idea/workspace.xml

Lines changed: 32 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/java/io/github/dbc/DuplicateCharactersCounterTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import org.junit.jupiter.params.provider.ValueSource;
88

99
import static org.junit.jupiter.api.Assertions.assertEquals;
10+
import static org.junit.jupiter.api.Assertions.assertThrows;
1011

1112
class DuplicateCharactersCounterTest {
1213
private DuplicateCharactersCounter counter;
@@ -39,4 +40,10 @@ void shouldReturnCount1ForNonDuplicateCharacters() {
3940
// Assert
4041
assertEquals(1, count, "the count value for all non duplicate characters should be 1");
4142
}
43+
44+
@Test
45+
@DisplayName("should throw an IllegalArgumentException for null input")
46+
void shouldThrowAnIllegalArgumentExceptionForNullInput() {
47+
assertThrows(IllegalArgumentException.class, () -> counter.countDuplicateCharacters(null));
48+
}
4249
}

0 commit comments

Comments
 (0)