-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSquareList.test.java
More file actions
30 lines (21 loc) · 898 Bytes
/
Copy pathSquareList.test.java
File metadata and controls
30 lines (21 loc) · 898 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
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Arrays;
import java.util.List;
public class SquareListTest {
@Test
public void testSquareList() {
List<Integer> inputList = Arrays.asList(4, 5, 20, 7, 10, 9);
List<Integer> expectedSquaredList = Arrays.asList(16, 25, 400, 49, 100, 81);
List<Integer> actualSquaredList = SquareList.squareList(inputList);
assertEquals(expectedSquaredList, actualSquaredList);
}
@Test
public void testEmptyList() {
List<Integer> inputList = Arrays.asList();
List<Integer> expectedSquaredList = Arrays.asList();
List<Integer> actualSquaredList = SquareList.squareList(inputList);
assertEquals(expectedSquaredList, actualSquaredList);
}
// ... Additional test cases as necessary ...
}