Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a811894

Browse files
add test for 289
1 parent a26b9cc commit a811894

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.solutions._289;
4+
import org.junit.BeforeClass;
5+
import org.junit.Test;
6+
7+
import static org.junit.Assert.assertEquals;
8+
9+
public class _289Test {
10+
private static _289.Solution1 solution1;
11+
private static int[][] board;
12+
13+
@BeforeClass
14+
public static void setup() {
15+
solution1 = new _289.Solution1();
16+
}
17+
18+
@Test
19+
public void test1() {
20+
board = new int[][]{
21+
{0, 1, 0},
22+
{0, 0, 1},
23+
{1, 1, 1},
24+
{0, 0, 0}
25+
};
26+
solution1.gameOfLife(board);
27+
int[][] expected = new int[][]{
28+
{0, 0, 0},
29+
{1, 0, 1},
30+
{0, 1, 1},
31+
{0, 1, 0}
32+
};
33+
assertEquals(expected, board);
34+
}
35+
36+
}

0 commit comments

Comments
 (0)