-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPalindromeCheck.test.java
More file actions
38 lines (30 loc) · 999 Bytes
/
Copy pathPalindromeCheck.test.java
File metadata and controls
38 lines (30 loc) · 999 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
31
32
33
34
35
36
37
38
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
public class PalindromeCheckTest {
@Test
public void testPalindromeWord() {
assertTrue(PalindromeCheck.isPalindrome("racecar"));
}
@Test
public void testNonPalindromeWord() {
assertFalse(PalindromeCheck.isPalindrome("hello"));
}
@Test
public void testPalindromeNumber() {
assertTrue(PalindromeCheck.isPalindrome("121"));
}
@Test
public void testPalindromeWithSpaces() {
assertTrue(PalindromeCheck.isPalindrome("A man a plan a canal Panama".replaceAll("\\s+", "")));
}
@Test
public void testPalindromeWithMixedCasing() {
assertTrue(PalindromeCheck.isPalindrome("Racecar"));
}
@Test
public void testEmptyString() {
assertTrue(PalindromeCheck.isPalindrome(""));
}
// ... Additional test cases as necessary ...
}