-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReverseArrayTest.java
More file actions
40 lines (32 loc) · 926 Bytes
/
Copy pathReverseArrayTest.java
File metadata and controls
40 lines (32 loc) · 926 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
39
40
package JunitTest;
import static org.junit.Assert.*;
import java.util.ArrayList;
import org.junit.Test;
import assignment3.ReverseArray;
public class ReverseArrayTest {
@Test
public void test(){
ArrayList<Integer> al=new ArrayList<>();
int[] numbers = {1, 2, 3, 4, 5, 6};
ReverseArray.reverse(numbers);
al.add(6);
al.add(5);
assertEquals(al,numbers);
//assertArrayEquals(new int[]{6, 5, 4, 3, 2, 1}, numbers);
}
}
/* @Test
public void test1(){
int[] numbers = {1, 2, 3, 4, 5, 6, 7};
ReverseArray.reverse(numbers);
assertArrayEquals(new int[]{7, 6, 5, 4, 3, 2, 1}, numbers);
}
}
*/
/* @Test
public void testReverseWithEmptyArray(){
int[] numbers = {};
HelloWorld.reverse(numbers);
assertArrayEquals(new int[]{}, numbers);
}
*/