|
|
@@ -15,23 +15,9 @@ public final class QueenAttackCalculatorTest {
|
|
15
|
15
|
@Rule
|
|
16
|
16
|
public ExpectedException expectedException = ExpectedException.none();
|
|
17
|
17
|
|
|
18
|
|
- @Test
|
|
19
|
|
- public void testNoExceptionThrownIfBothQueenPositionsValid() {
|
|
20
|
|
- new QueenAttackCalculator(new BoardCoordinate(2, 2), new BoardCoordinate(0, 7));
|
|
21
|
|
- }
|
|
22
|
|
-
|
|
23
|
|
- @Ignore
|
|
24
|
|
- @Test
|
|
25
|
|
- public void testNullInputNotAllowed() {
|
|
26
|
|
- expectedException.expect(IllegalArgumentException.class);
|
|
27
|
|
- expectedException.expectMessage("You must supply valid board coordinates for both Queens.");
|
|
28
|
|
-
|
|
29
|
|
- new QueenAttackCalculator(null, new BoardCoordinate(0, 7));
|
|
30
|
|
- }
|
|
31
|
|
-
|
|
32
|
18
|
@Ignore
|
|
33
|
19
|
@Test
|
|
34
|
|
- public void testNegativeRankNotAllowed() {
|
|
|
20
|
+ public void testCoordinateWithNegativeRankNotAllowed() {
|
|
35
|
21
|
expectedException.expect(IllegalArgumentException.class);
|
|
36
|
22
|
expectedException.expectMessage("Coordinate must have positive rank.");
|
|
37
|
23
|
|
|
|
@@ -40,7 +26,7 @@ public final class QueenAttackCalculatorTest {
|
|
40
|
26
|
|
|
41
|
27
|
@Ignore
|
|
42
|
28
|
@Test
|
|
43
|
|
- public void testRankGreaterThan7NotAllowed() {
|
|
|
29
|
+ public void testCoordinateWithRankGreaterThan7NotAllowed() {
|
|
44
|
30
|
expectedException.expect(IllegalArgumentException.class);
|
|
45
|
31
|
expectedException.expectMessage("Coordinate must have rank <= 7.");
|
|
46
|
32
|
|
|
|
@@ -49,7 +35,7 @@ public final class QueenAttackCalculatorTest {
|
|
49
|
35
|
|
|
50
|
36
|
@Ignore
|
|
51
|
37
|
@Test
|
|
52
|
|
- public void testNegativeFileNotAllowed() {
|
|
|
38
|
+ public void testCoordinateWithNegativeFileNotAllowed() {
|
|
53
|
39
|
expectedException.expect(IllegalArgumentException.class);
|
|
54
|
40
|
expectedException.expectMessage("Coordinate must have positive file.");
|
|
55
|
41
|
|
|
|
@@ -58,7 +44,7 @@ public final class QueenAttackCalculatorTest {
|
|
58
|
44
|
|
|
59
|
45
|
@Ignore
|
|
60
|
46
|
@Test
|
|
61
|
|
- public void testFileGreaterThan7NotAllowed() {
|
|
|
47
|
+ public void testCoordinateWithFileGreaterThan7NotAllowed() {
|
|
62
|
48
|
expectedException.expect(IllegalArgumentException.class);
|
|
63
|
49
|
expectedException.expectMessage("Coordinate must have file <= 7.");
|
|
64
|
50
|
|
|
|
@@ -67,6 +53,15 @@ public final class QueenAttackCalculatorTest {
|
|
67
|
53
|
|
|
68
|
54
|
@Ignore
|
|
69
|
55
|
@Test
|
|
|
56
|
+ public void testNullCoordinateNotAllowed() {
|
|
|
57
|
+ expectedException.expect(IllegalArgumentException.class);
|
|
|
58
|
+ expectedException.expectMessage("You must supply valid board coordinates for both Queens.");
|
|
|
59
|
+
|
|
|
60
|
+ new QueenAttackCalculator(null, new BoardCoordinate(0, 7));
|
|
|
61
|
+ }
|
|
|
62
|
+
|
|
|
63
|
+ @Ignore
|
|
|
64
|
+ @Test
|
|
70
|
65
|
public void testQueensMustNotOccupyTheSameSquare() {
|
|
71
|
66
|
expectedException.expect(IllegalArgumentException.class);
|
|
72
|
67
|
expectedException.expectMessage("Queens may not occupy the same board coordinate.");
|
|
|
@@ -74,6 +69,7 @@ public final class QueenAttackCalculatorTest {
|
|
74
|
69
|
new QueenAttackCalculator(new BoardCoordinate(2, 2), new BoardCoordinate(2, 2));
|
|
75
|
70
|
}
|
|
76
|
71
|
|
|
|
72
|
+ @Ignore
|
|
77
|
73
|
@Test
|
|
78
|
74
|
public void testQueensThatDoNotShareRankFileOrDiagonalCannotAttack() {
|
|
79
|
75
|
final QueenAttackCalculator calculator
|