forked from ucsd-cse15l-f22/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTests.java
More file actions
40 lines (33 loc) · 970 Bytes
/
ArrayTests.java
File metadata and controls
40 lines (33 loc) · 970 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
import static org.junit.Assert.*;
import org.junit.*;
public class ArrayTests {
@Test
public void testReverseInPlace() {
int[] input1 = { 3 };
ArrayExamples.reverseInPlace(input1);
assertArrayEquals(new int[]{ 3 }, input1);
}
@Test
public void testReversed() {
int[] input1 = { };
assertArrayEquals(new int[]{ }, ArrayExamples.reversed(input1));
}
@Test
public void testReverseInPlace1(){
int[] inputTest = { 1, 2, 3, 4, 5 };
ArrayExamples.reverseInPlace(inputTest);
assertArrayEquals(new int[]{ 5, 4, 3, 2, 1 }, inputTest);
}
@Test
public void testReversed1() {
int[] reverseTest1 = { 8 };
ArrayExamples.reverseInPlace(reverseTest1);
assertArrayEquals(new int[]{ 8 }, ArrayExamples.reversed(reverseTest1));
}
@Test
public void testAverageWithoutLowest(){
double[] AverageTest = {0, 1, 3};
ArrayExamples.averageWithoutLowest(AverageTest);
System.out.println(AverageTest);
}
}