- Notifications
You must be signed in to change notification settings - Fork 19.9k
/
Copy pathAlphabeticalTest.java
30 lines (23 loc) · 912 Bytes
/
AlphabeticalTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
packagecom.thealgorithms.strings;
importstaticorg.junit.jupiter.api.Assertions.assertFalse;
importstaticorg.junit.jupiter.api.Assertions.assertTrue;
importorg.junit.jupiter.api.Test;
publicclassAlphabeticalTest {
@Test
publicvoidisAlphabetical() {
// expected to be true
Stringinput1 = "abcdefghijklmno";
Stringinput2 = "abcdxxxyzzzz";
Stringinput3 = "fpw";
// expected to be false
Stringinput4 = "123a";
Stringinput5 = "abcABC";
Stringinput6 = "abcdefghikjlmno";
assertTrue(Alphabetical.isAlphabetical(input1));
assertTrue(Alphabetical.isAlphabetical(input2));
assertTrue(Alphabetical.isAlphabetical(input3));
assertFalse(Alphabetical.isAlphabetical(input4));
assertFalse(Alphabetical.isAlphabetical(input5));
assertFalse(Alphabetical.isAlphabetical(input6));
}
}