forked from ucsd-cse15l-w23/lab3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayTests.java
More file actions
47 lines (39 loc) · 1.16 KB
/
ArrayTests.java
File metadata and controls
47 lines (39 loc) · 1.16 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
40
41
42
43
44
45
46
47
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 testReverseInPlaceTwo() {
// int[] input1 = { 3, 4, 5 };
// ArrayExamples.reverseInPlace(input1);
// assertArrayEquals(new int[]{ 5, 4, 3 }, input1);
// }
// @Test
// public void testReverseInPlaceThree() {
// int[] input1 = { 6, 7, 8, 9, 10 };
// ArrayExamples.reverseInPlace(input1);
// assertArrayEquals(new int[]{ 10, 9, 8, 7, 6 }, input1);
// }
@Test
public void testMinArray1() {
double[] input1 = { 1.0, 1.0, 1.0, 1.0 };
double d = ArrayExamples.averageWithoutLowest(input1);
assertEquals(1.0, d, 0.0001);
}
@Test
public void testMinArray2() {
double[] input1 = { 1.0, 2.0, 3.0 };
double d = ArrayExamples.averageWithoutLowest(input1);
assertEquals(2.5, d, 0.0001);
}
}