Skip to content

Commit 89f5fed

Browse files
committed
add test case 1
1 parent 0be3e80 commit 89f5fed

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

.idea/workspace.xml

Lines changed: 31 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package io.github.dbc;
22

3-
import org.junit.jupiter.api.Assertions;
43
import org.junit.jupiter.api.BeforeEach;
54
import org.junit.jupiter.api.DisplayName;
65
import org.junit.jupiter.api.Test;
76

7+
import static org.junit.jupiter.api.Assertions.assertEquals;
8+
89
class DuplicateCharactersCounterTest {
910
private DuplicateCharactersCounter counter;
1011

@@ -14,8 +15,15 @@ void setUp() {
1415
}
1516

1617
@Test
17-
@DisplayName("")
18-
void countDuplicateCharacters() {
19-
Assertions.fail();
18+
@DisplayName("should return count as 1 for all non duplicate characters")
19+
void shouldReturnCount1ForNonDuplicateCharacters() {
20+
// Arrange
21+
String input = "abcdefghijklmnopqrstuvwxyz";
22+
// Act
23+
var characterIntegerMap = counter.countDuplicateCharacters(input);
24+
// get the value for key 'a'
25+
var count = characterIntegerMap.get('a');
26+
// Assert
27+
assertEquals(1, count, "the count value for all non duplicate characters should be 1");
2028
}
2129
}

0 commit comments

Comments
 (0)