-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringReversal.test.java
More file actions
39 lines (33 loc) · 1.11 KB
/
Copy pathStringReversal.test.java
File metadata and controls
39 lines (33 loc) · 1.11 KB
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
39
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class StringReversalTest {
@Test
public void testReverseString_BasicCase() {
String input = "Hello, World!";
String expected = "!dlroW ,olleH";
String result = StringReversal.reverseString(input);
assertEquals(expected, result);
}
@Test
public void testReverseString_EmptyString() {
String input = "";
String expected = "";
String result = StringReversal.reverseString(input);
assertEquals(expected, result);
}
@Test
public void testReverseString_SingleCharacter() {
String input = "a";
String expected = "a";
String result = StringReversal.reverseString(input);
assertEquals(expected, result);
}
@Test
public void testReverseString_SpecialCharacters() {
String input = "@#*123";
String expected = "321*#@";
String result = StringReversal.reverseString(input);
assertEquals(expected, result);
}
// ... Additional test cases as necessary ...
}