File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
src/test/java/com/thealgorithms/strings Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .thealgorithms .strings ;
2+
3+ import org .junit .jupiter .api .Test ;
4+ import static org .junit .jupiter .api .Assertions .*;
5+
6+
7+ public class CharacterSameTest {
8+ @ Test
9+ public void isAllCharactersSame () {
10+ String input1 = "aaa" ;
11+ String input2 = "abc" ;
12+ String input3 = "1 1 1 1" ;
13+ String input4 = "111" ;
14+ String input5 = "" ;
15+ String input6 = " " ;
16+ String input7 = ". " ;
17+
18+ assertTrue (CharactersSame .isAllCharactersSame (input1 ));
19+ assertFalse (CharactersSame .isAllCharactersSame (input2 ));
20+ assertFalse (CharactersSame .isAllCharactersSame (input3 ));
21+ assertTrue (CharactersSame .isAllCharactersSame (input4 ));
22+ assertTrue (CharactersSame .isAllCharactersSame (input5 ));
23+ assertTrue (CharactersSame .isAllCharactersSame (input6 ));
24+ assertFalse (CharactersSame .isAllCharactersSame (input7 ));
25+
26+ }
27+
28+ }
You can’t perform that action at this time.
0 commit comments