forked from TheAlgorithms/Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlphabeticalTest.java
More file actions
30 lines (23 loc) · 912 Bytes
/
AlphabeticalTest.java
File metadata and controls
30 lines (23 loc) · 912 Bytes
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
package com.thealgorithms.strings;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public class AlphabeticalTest {
@Test
public void isAlphabetical() {
// expected to be true
String input1 = "abcdefghijklmno";
String input2 = "abcdxxxyzzzz";
String input3 = "fpw";
// expected to be false
String input4 = "123a";
String input5 = "abcABC";
String input6 = "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));
}
}