-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestFlatThatArrayFunctions.java
More file actions
35 lines (28 loc) · 1.05 KB
/
Copy pathTestFlatThatArrayFunctions.java
File metadata and controls
35 lines (28 loc) · 1.05 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
import static org.junit.Assert.*;
import java.util.List;
import org.junit.Test;
public class TestFlatThatArrayFunctions {
@SuppressWarnings("deprecation")
@Test
public void FlatTheArrayNull() {
Object[] unstructuredArray = null;
List<Integer> flatenedArrayList = null;
assertEquals(null, FlatThatArray.FlatTheArray(unstructuredArray, flatenedArrayList));
}
@SuppressWarnings("deprecation")
@Test
public void FlatTheArraySimple() {
Object[] unstructuredArray = { 1, 2, 3, 4 };
Integer[] unstructuredArrayAnswer = { 1, 2, 3, 4 };
List<Integer> flatenedArrayList = null;
assertEquals(unstructuredArrayAnswer, FlatThatArray.FlatTheArray(unstructuredArray, flatenedArrayList));
}
@SuppressWarnings("deprecation")
@Test
public void FlatTheArrayNested() {
Object[] unstructuredArray = { 1, new Object[] { 2, 3, new Object[] { 4, 5 } } };
Integer[] unstructuredArrayAnswer = { 1, 2, 3, 4, 5 };
List<Integer> flatenedArrayList = null;
assertEquals(unstructuredArrayAnswer, FlatThatArray.FlatTheArray(unstructuredArray, flatenedArrayList));
}
}