Browse Source

Resequence/rename queen-attack tests

Stuart Kent 9 years ago
parent
commit
21b8ca2d23
1 changed files with 14 additions and 18 deletions
  1. 14
    18
      exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java

+ 14
- 18
exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java View File

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