@@ -12,102 +12,114 @@ public final class QueenAttackCalculatorTest {
1212
1313 @ Test
1414 public void testNoExceptionThrownIfBothQueenPositionsValid () {
15- new QueenAttackCalculator (new int []{ 2 , 2 } , new int []{ 0 , 7 } );
15+ new QueenAttackCalculator (new BoardCoordinate ( 2 , 2 ) , new BoardCoordinate ( 0 , 7 ) );
1616 }
1717
1818 @ Ignore
1919 @ Test
2020 public void testNullInputNotAllowed () {
2121 expectedException .expect (IllegalArgumentException .class );
22- expectedException .expectMessage ("You must supply valid 2-dimensional coordinate arrays for both Queens." );
22+ expectedException .expectMessage ("You must supply valid board coordinates for both Queens." );
2323
24- new QueenAttackCalculator (null , new int []{ 3 , 4 } );
24+ new QueenAttackCalculator (null , new BoardCoordinate ( 0 , 7 ) );
2525 }
2626
2727 @ Ignore
2828 @ Test
2929 public void testNegativeRankNotAllowed () {
3030 expectedException .expect (IllegalArgumentException .class );
31- expectedException .expectMessage ("Queens must both have positive rank." );
31+ expectedException .expectMessage ("Coordinate must have positive rank." );
3232
33- new QueenAttackCalculator ( new int []{ -2 , 2 }, new int []{ 2 , 2 } );
33+ new BoardCoordinate ( -2 , 2 );
3434 }
3535
3636 @ Ignore
3737 @ Test
3838 public void testRankGreaterThan7NotAllowed () {
3939 expectedException .expect (IllegalArgumentException .class );
40- expectedException .expectMessage ("Queens must both have rank <= 7." );
40+ expectedException .expectMessage ("Coordinate must have rank <= 7." );
4141
42- new QueenAttackCalculator ( new int []{ 8 , 4 }, new int []{ 1 , 6 } );
42+ new BoardCoordinate ( 8 , 4 );
4343 }
4444
4545 @ Ignore
4646 @ Test
4747 public void testNegativeFileNotAllowed () {
4848 expectedException .expect (IllegalArgumentException .class );
49- expectedException .expectMessage ("Queens must both have positive file." );
49+ expectedException .expectMessage ("Coordinate must have positive file." );
5050
51- new QueenAttackCalculator ( new int []{ 2 , -2 }, new int []{ 5 , 3 } );
51+ new BoardCoordinate ( 2 , -2 );
5252 }
5353
5454 @ Ignore
5555 @ Test
5656 public void testFileGreaterThan7NotAllowed () {
5757 expectedException .expect (IllegalArgumentException .class );
58- expectedException .expectMessage ("Queens must both have file <= 7." );
58+ expectedException .expectMessage ("Coordinate must have file <= 7." );
5959
60- new QueenAttackCalculator ( new int []{ 4 , 8 }, new int []{ 7 , 4 } );
60+ new BoardCoordinate ( 4 , 8 );
6161 }
6262
6363 @ Ignore
6464 @ Test
6565 public void testQueensMustNotOccupyTheSameSquare () {
6666 expectedException .expect (IllegalArgumentException .class );
67- expectedException .expectMessage ("Queens must not occupy the same square ." );
67+ expectedException .expectMessage ("Queens may not occupy the same board coordinate ." );
6868
69- new QueenAttackCalculator (new int []{ 2 , 2 } , new int []{ 2 , 2 } );
69+ new QueenAttackCalculator (new BoardCoordinate ( 2 , 2 ) , new BoardCoordinate ( 2 , 2 ) );
7070 }
7171
7272 @ Ignore
7373 @ Test
7474 public void testQueensCanAttackOnTheSameRank () {
75- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{2 , 4 }, new int []{2 , 6 });
75+ final QueenAttackCalculator calculator
76+ = new QueenAttackCalculator (new BoardCoordinate (2 , 4 ), new BoardCoordinate (2 , 6 ));
77+
7678 assertTrue (calculator .canQueensAttackOneAnother ());
7779 }
7880
7981 @ Ignore
8082 @ Test
8183 public void testQueensCanAttackOnTheSameFile () {
82- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{4 , 5 }, new int []{2 , 5 });
84+ final QueenAttackCalculator calculator
85+ = new QueenAttackCalculator (new BoardCoordinate (4 , 5 ), new BoardCoordinate (2 , 5 ));
86+
8387 assertTrue (calculator .canQueensAttackOneAnother ());
8488 }
8589
8690 @ Ignore
8791 @ Test
8892 public void testQueensCanAttackOnFirstDiagonal () {
89- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{2 , 2 }, new int []{0 , 4 });
93+ final QueenAttackCalculator calculator
94+ = new QueenAttackCalculator (new BoardCoordinate (2 , 2 ), new BoardCoordinate (0 , 4 ));
95+
9096 assertTrue (calculator .canQueensAttackOneAnother ());
9197 }
9298
9399 @ Ignore
94100 @ Test
95101 public void testQueensCanAttackOnSecondDiagonal () {
96- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{2 , 2 }, new int []{3 , 1 });
102+ final QueenAttackCalculator calculator
103+ = new QueenAttackCalculator (new BoardCoordinate (2 , 2 ), new BoardCoordinate (3 , 1 ));
104+
97105 assertTrue (calculator .canQueensAttackOneAnother ());
98106 }
99107
100108 @ Ignore
101109 @ Test
102110 public void testQueensCanAttackOnThirdDiagonal () {
103- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{2 , 2 }, new int []{1 , 1 });
111+ final QueenAttackCalculator calculator
112+ = new QueenAttackCalculator (new BoardCoordinate (2 , 2 ), new BoardCoordinate (1 , 1 ));
113+
104114 assertTrue (calculator .canQueensAttackOneAnother ());
105115 }
106116
107117 @ Ignore
108118 @ Test
109119 public void testQueensCanAttackOnFourthDiagonal () {
110- final QueenAttackCalculator calculator = new QueenAttackCalculator (new int []{2 , 2 }, new int []{5 , 5 });
120+ final QueenAttackCalculator calculator
121+ = new QueenAttackCalculator (new BoardCoordinate (2 , 2 ), new BoardCoordinate (5 , 5 ));
122+
111123 assertTrue (calculator .canQueensAttackOneAnother ());
112124 }
113125
0 commit comments