|
1 | 1 | packagecom.fishercoder.firstthousand;
|
2 | 2 |
|
3 | 3 | importcom.fishercoder.solutions.firstthousand._999;
|
4 |
| -importorg.junit.BeforeClass; |
5 |
| -importorg.junit.Test; |
| 4 | +importorg.junit.jupiter.api.BeforeEach; |
| 5 | +importorg.junit.jupiter.api.Test; |
6 | 6 |
|
7 |
| -importstaticorg.junit.Assert.assertEquals; |
| 7 | +importstaticorg.junit.jupiter.api.Assertions.assertEquals; |
8 | 8 |
|
9 | 9 | publicclass_999Test {
|
10 |
| -privatestatic_999.Solution1solution1; |
11 |
| -privatestaticchar[][]board; |
| 10 | +privatestatic_999.Solution1solution1; |
| 11 | +privatestaticchar[][]board; |
12 | 12 |
|
13 |
| -@BeforeClass |
14 |
| -publicstaticvoidsetup() { |
15 |
| -solution1 =new_999.Solution1(); |
16 |
| - } |
| 13 | +@BeforeEach |
| 14 | +publicvoidsetup() { |
| 15 | +solution1 =new_999.Solution1(); |
| 16 | +} |
17 | 17 |
|
18 |
| -@Test |
19 |
| -publicvoidtest1() { |
20 |
| -board =newchar[][]{ |
21 |
| - {'.','.','.','.','.','.','.','.'}, |
22 |
| - {'.','.','.','p','.','.','.','.'}, |
23 |
| - {'.','.','.','R','.','.','.','p'}, |
24 |
| - {'.','.','.','.','.','.','.','.'}, |
25 |
| - {'.','.','.','.','.','.','.','.'}, |
26 |
| - {'.','.','.','p','.','.','.','.'}, |
27 |
| - {'.','.','.','.','.','.','.','.'}, |
28 |
| - {'.','.','.','.','.','.','.','.'}, |
29 |
| - }; |
30 |
| -assertEquals(3,solution1.numRookCaptures(board)); |
31 |
| - } |
| 18 | +@Test |
| 19 | +publicvoidtest1() { |
| 20 | +board =newchar[][]{ |
| 21 | +{'.','.','.','.','.','.','.','.'}, |
| 22 | +{'.','.','.','p','.','.','.','.'}, |
| 23 | +{'.','.','.','R','.','.','.','p'}, |
| 24 | +{'.','.','.','.','.','.','.','.'}, |
| 25 | +{'.','.','.','.','.','.','.','.'}, |
| 26 | +{'.','.','.','p','.','.','.','.'}, |
| 27 | +{'.','.','.','.','.','.','.','.'}, |
| 28 | +{'.','.','.','.','.','.','.','.'}, |
| 29 | +}; |
| 30 | +assertEquals(3,solution1.numRookCaptures(board)); |
| 31 | +} |
32 | 32 |
|
33 |
| -@Test |
34 |
| -publicvoidtest2() { |
35 |
| -board =newchar[][]{ |
36 |
| - {'.','.','.','.','.','.','.','.'}, |
37 |
| - {'.','p','p','p','p','p','.','.'}, |
38 |
| - {'.','p','p','B','p','p','.','.'}, |
39 |
| - {'.','p','B','R','B','p','.','.'}, |
40 |
| - {'.','p','p','B','p','p','.','.'}, |
41 |
| - {'.','p','p','p','p','p','.','.'}, |
42 |
| - {'.','.','.','.','.','.','.','.'}, |
43 |
| - {'.','.','.','.','.','.','.','.'}, |
44 |
| - }; |
45 |
| -assertEquals(0,solution1.numRookCaptures(board)); |
46 |
| - } |
| 33 | +@Test |
| 34 | +publicvoidtest2() { |
| 35 | +board =newchar[][]{ |
| 36 | +{'.','.','.','.','.','.','.','.'}, |
| 37 | +{'.','p','p','p','p','p','.','.'}, |
| 38 | +{'.','p','p','B','p','p','.','.'}, |
| 39 | +{'.','p','B','R','B','p','.','.'}, |
| 40 | +{'.','p','p','B','p','p','.','.'}, |
| 41 | +{'.','p','p','p','p','p','.','.'}, |
| 42 | +{'.','.','.','.','.','.','.','.'}, |
| 43 | +{'.','.','.','.','.','.','.','.'}, |
| 44 | +}; |
| 45 | +assertEquals(0,solution1.numRookCaptures(board)); |
| 46 | +} |
47 | 47 |
|
48 |
| -@Test |
49 |
| -publicvoidtest3() { |
50 |
| -board =newchar[][]{ |
51 |
| - {'.','.','.','.','.','.','.','.'}, |
52 |
| - {'.','.','.','p','.','.','.','.'}, |
53 |
| - {'.','.','.','p','.','.','.','p'}, |
54 |
| - {'p','p','.','R','.','p','B','.'}, |
55 |
| - {'.','.','.','.','.','.','.','.'}, |
56 |
| - {'.','.','.','B','.','.','.','.'}, |
57 |
| - {'.','.','.','p','.','.','.','.'}, |
58 |
| - {'.','.','.','.','.','.','.','.'}, |
59 |
| - }; |
60 |
| -assertEquals(3,solution1.numRookCaptures(board)); |
61 |
| - } |
| 48 | +@Test |
| 49 | +publicvoidtest3() { |
| 50 | +board =newchar[][]{ |
| 51 | +{'.','.','.','.','.','.','.','.'}, |
| 52 | +{'.','.','.','p','.','.','.','.'}, |
| 53 | +{'.','.','.','p','.','.','.','p'}, |
| 54 | +{'p','p','.','R','.','p','B','.'}, |
| 55 | +{'.','.','.','.','.','.','.','.'}, |
| 56 | +{'.','.','.','B','.','.','.','.'}, |
| 57 | +{'.','.','.','p','.','.','.','.'}, |
| 58 | +{'.','.','.','.','.','.','.','.'}, |
| 59 | +}; |
| 60 | +assertEquals(3,solution1.numRookCaptures(board)); |
| 61 | +} |
62 | 62 | }
|