File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
src/test/java/com/thealgorithms/strings Expand file tree Collapse file tree 1 file changed +30
-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+
5+ import static org .junit .jupiter .api .Assertions .*;
6+
7+
8+ public class AlphabeticalTest {
9+ @ Test
10+ public void isAlphabetical () {
11+ // expected to be true
12+ String input1 = "abcdefghijklmno" ;
13+ String input2 = "abcdxxxyzzzz" ;
14+ String input3 = "fpw" ;
15+
16+ // expected to be false
17+ String input4 = "123a" ;
18+ String input5 = "abcABC" ;
19+ String input6 = "abcdefghikjlmno" ;
20+
21+ assertTrue (Alphabetical .isAlphabetical (input1 ));
22+ assertTrue (Alphabetical .isAlphabetical (input2 ));
23+ assertTrue (Alphabetical .isAlphabetical (input3 ));
24+
25+ assertFalse (Alphabetical .isAlphabetical (input4 ));
26+ assertFalse (Alphabetical .isAlphabetical (input5 ));
27+ assertFalse (Alphabetical .isAlphabetical (input6 ));
28+ }
29+
30+ }
You can’t perform that action at this time.
0 commit comments