-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMaxFinderTest.java
More file actions
48 lines (35 loc) · 1.26 KB
/
MaxFinderTest.java
File metadata and controls
48 lines (35 loc) · 1.26 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
48
import static org.junit.Assert.*;
import java.util.concurrent.ExecutionException;
import org.junit.Test;
public class MaxFinderTest {
@Test
public void testOddElement() throws InterruptedException, ExecutionException {
int[] data = {1, 2, 56, -98, 10};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
@Test
public void testEvenElement() throws InterruptedException, ExecutionException {
int[] data = {1, 2, 56, 23, -98, 10};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
@Test
public void testEnd() throws InterruptedException, ExecutionException {
int[] data = {1, 2, 23, -98, 10, 56};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
@Test
public void testBeginning() throws InterruptedException, ExecutionException {
int[] data = {56, 1, 2, 23, -98, 10, 5};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
@Test
public void testOneElement() throws InterruptedException, ExecutionException {
int[] data = {56};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
@Test
public void testOddElementAfterSplit() throws InterruptedException, ExecutionException {
int[] data = {1, 2, -98, 56, 10};
assertEquals(56, MultithreadedMaxFinder.max(data));
}
}