Skip to content

Commit d5be205

Browse files
committed
add test case 4
1 parent 9fcf6d0 commit d5be205

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,15 @@ void shouldReturnCount1ForNonDuplicateCharacters() {
4646
void shouldThrowAnIllegalArgumentExceptionForNullInput() {
4747
assertThrows(IllegalArgumentException.class, () -> counter.countDuplicateCharacters(null));
4848
}
49+
50+
@Test
51+
@DisplayName("should return empty map for empty input")
52+
void shouldReturnEmptyMapForEmptyInput() {
53+
// Arrange
54+
String input = "";
55+
// Act
56+
var characterIntegerMap = counter.countDuplicateCharacters(input);
57+
// Assert
58+
assertEquals(0, characterIntegerMap.size(), "the map should be empty");
59+
}
4960
}

0 commit comments

Comments
 (0)