forked from fishercoder1534/Leetcode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_498Test.java
45 lines (39 loc) · 1.03 KB
/
_498Test.java
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
package com.fishercoder;
import com.fishercoder.solutions._498;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.assertArrayEquals;
/**
* Created by fishercoder on 5/26/17.
*/
public class _498Test {
private static _498 test;
private static int[][] matrix;
private static int[] expected;
@BeforeClass
public static void setup(){
test = new _498();
}
@Test
public void test1(){
matrix = new int[][]{
{1,2,3},
{4,5,6},
{7,8,9},
};
expected = new int[]{1,2,4,7,5,3,6,8,9};
assertArrayEquals(expected, test.findDiagonalOrder(matrix));
}
@Test
public void test2(){
matrix = new int[][]{
{1,2,3},
{4,5,6},
{7,8,9},
{10,11,12},
{13,14,15},
};
expected = new int[]{1,2,4,7,5,3,6,8,10,13,11,9,12,14,15};
assertArrayEquals(expected, test.findDiagonalOrder(matrix));
}
}