瀏覽代碼

Merge pull request #508 from mraediaz/issue-445

Clock : add hint to @Ignore annotations
FridaTveit 9 年之前
父節點
當前提交
fec5cd541a

+ 16
- 16
exercises/clock/src/test/java/ClockAddTest.java 查看文件

5
 
5
 
6
 public class ClockAddTest {
6
 public class ClockAddTest {
7
 
7
 
8
-    @Ignore
8
+    @Ignore("Remove to run test")
9
     @Test
9
     @Test
10
     public void addMinutes() {
10
     public void addMinutes() {
11
         Clock clock = new Clock(10, 0);
11
         Clock clock = new Clock(10, 0);
13
         assertEquals("10:03", clock.toString());
13
         assertEquals("10:03", clock.toString());
14
     }
14
     }
15
 
15
 
16
-    @Ignore
16
+    @Ignore("Remove to run test")
17
     @Test
17
     @Test
18
     public void addNoMinutes() {
18
     public void addNoMinutes() {
19
         Clock clock = new Clock(6, 41);
19
         Clock clock = new Clock(6, 41);
21
         assertEquals("06:41", clock.toString());
21
         assertEquals("06:41", clock.toString());
22
     }
22
     }
23
 
23
 
24
-    @Ignore
24
+    @Ignore("Remove to run test")
25
     @Test
25
     @Test
26
     public void addToNextHour() {
26
     public void addToNextHour() {
27
         Clock clock = new Clock(0, 45);
27
         Clock clock = new Clock(0, 45);
29
         assertEquals("01:25", clock.toString());
29
         assertEquals("01:25", clock.toString());
30
     }
30
     }
31
 
31
 
32
-    @Ignore
32
+    @Ignore("Remove to run test")
33
     @Test
33
     @Test
34
     public void addMoreThanOneHour() {
34
     public void addMoreThanOneHour() {
35
         Clock clock = new Clock(10, 0);
35
         Clock clock = new Clock(10, 0);
37
         assertEquals("11:01", clock.toString());
37
         assertEquals("11:01", clock.toString());
38
     }
38
     }
39
 
39
 
40
-    @Ignore
40
+    @Ignore("Remove to run test")
41
     @Test
41
     @Test
42
     public void addMoreThanTwoHoursWithCarry() {
42
     public void addMoreThanTwoHoursWithCarry() {
43
         Clock clock = new Clock(0, 45);
43
         Clock clock = new Clock(0, 45);
45
         assertEquals("03:25", clock.toString());
45
         assertEquals("03:25", clock.toString());
46
     }
46
     }
47
 
47
 
48
-    @Ignore
48
+    @Ignore("Remove to run test")
49
     @Test
49
     @Test
50
     public void addAcrossMidnight() {
50
     public void addAcrossMidnight() {
51
         Clock clock = new Clock(23, 59);
51
         Clock clock = new Clock(23, 59);
53
         assertEquals("00:01", clock.toString());
53
         assertEquals("00:01", clock.toString());
54
     }
54
     }
55
 
55
 
56
-    @Ignore
56
+    @Ignore("Remove to run test")
57
     @Test
57
     @Test
58
     public void addMoreThanOneDay() {
58
     public void addMoreThanOneDay() {
59
         Clock clock = new Clock(5, 32);
59
         Clock clock = new Clock(5, 32);
61
         assertEquals("06:32", clock.toString());
61
         assertEquals("06:32", clock.toString());
62
     }
62
     }
63
 
63
 
64
-    @Ignore
64
+    @Ignore("Remove to run test")
65
     @Test
65
     @Test
66
     public void addMoreThanTwoDays() {
66
     public void addMoreThanTwoDays() {
67
         Clock clock = new Clock(1, 1);
67
         Clock clock = new Clock(1, 1);
69
         assertEquals("11:21", clock.toString());
69
         assertEquals("11:21", clock.toString());
70
     }
70
     }
71
 
71
 
72
-    @Ignore
72
+    @Ignore("Remove to run test")
73
     @Test
73
     @Test
74
     public void subtractMinutes() {
74
     public void subtractMinutes() {
75
         Clock clock = new Clock(10, 3);
75
         Clock clock = new Clock(10, 3);
77
         assertEquals("10:00", clock.toString());
77
         assertEquals("10:00", clock.toString());
78
     }
78
     }
79
 
79
 
80
-    @Ignore
80
+    @Ignore("Remove to run test")
81
     @Test
81
     @Test
82
     public void subtractToPreviousHour() {
82
     public void subtractToPreviousHour() {
83
         Clock clock = new Clock(10, 3);
83
         Clock clock = new Clock(10, 3);
85
         assertEquals("09:33", clock.toString());
85
         assertEquals("09:33", clock.toString());
86
     }
86
     }
87
 
87
 
88
-    @Ignore
88
+    @Ignore("Remove to run test")
89
     @Test
89
     @Test
90
     public void subtractMoreThanAnHour() {
90
     public void subtractMoreThanAnHour() {
91
         Clock clock = new Clock(10, 3);
91
         Clock clock = new Clock(10, 3);
93
         assertEquals("08:53", clock.toString());
93
         assertEquals("08:53", clock.toString());
94
     }
94
     }
95
 
95
 
96
-    @Ignore
96
+    @Ignore("Remove to run test")
97
     @Test
97
     @Test
98
     public void subtractAcrossMidnight() {
98
     public void subtractAcrossMidnight() {
99
         Clock clock = new Clock(0, 3);
99
         Clock clock = new Clock(0, 3);
101
         assertEquals("23:59", clock.toString());
101
         assertEquals("23:59", clock.toString());
102
     }
102
     }
103
 
103
 
104
-    @Ignore
104
+    @Ignore("Remove to run test")
105
     @Test
105
     @Test
106
     public void subtractMoreThanTwoHours() {
106
     public void subtractMoreThanTwoHours() {
107
         Clock clock = new Clock(0, 0);
107
         Clock clock = new Clock(0, 0);
109
         assertEquals("21:20", clock.toString());
109
         assertEquals("21:20", clock.toString());
110
     }
110
     }
111
 
111
 
112
-    @Ignore
112
+    @Ignore("Remove to run test")
113
     @Test
113
     @Test
114
     public void subtractMoreThanTwoHoursWithBorrow() {
114
     public void subtractMoreThanTwoHoursWithBorrow() {
115
         Clock clock = new Clock(6, 15);
115
         Clock clock = new Clock(6, 15);
117
         assertEquals("03:35", clock.toString());
117
         assertEquals("03:35", clock.toString());
118
     }
118
     }
119
 
119
 
120
-    @Ignore
120
+    @Ignore("Remove to run test")
121
     @Test
121
     @Test
122
     public void subtractMoreThanOneDay() {
122
     public void subtractMoreThanOneDay() {
123
         Clock clock = new Clock(5, 32);
123
         Clock clock = new Clock(5, 32);
125
         assertEquals("04:32", clock.toString());
125
         assertEquals("04:32", clock.toString());
126
     }
126
     }
127
 
127
 
128
-    @Ignore
128
+    @Ignore("Remove to run test")
129
     @Test
129
     @Test
130
     public void subtractMoreThanTwoDays() {
130
     public void subtractMoreThanTwoDays() {
131
         Clock clock = new Clock(2, 20);
131
         Clock clock = new Clock(2, 20);

+ 18
- 18
exercises/clock/src/test/java/ClockCreationTest.java 查看文件

10
         assertEquals("08:00", new Clock(8, 0).toString());
10
         assertEquals("08:00", new Clock(8, 0).toString());
11
     }
11
     }
12
 
12
 
13
-    @Ignore
13
+    @Ignore("Remove to run test")
14
     @Test
14
     @Test
15
     public void canPrintTimeWithMinutes() {
15
     public void canPrintTimeWithMinutes() {
16
         assertEquals("11:09", new Clock(11, 9).toString());
16
         assertEquals("11:09", new Clock(11, 9).toString());
17
     }
17
     }
18
 
18
 
19
-    @Ignore
19
+    @Ignore("Remove to run test")
20
     @Test
20
     @Test
21
     public void midnightPrintsAsZero() {
21
     public void midnightPrintsAsZero() {
22
         assertEquals("00:00", new Clock(24, 0).toString());
22
         assertEquals("00:00", new Clock(24, 0).toString());
23
     }
23
     }
24
 
24
 
25
-    @Ignore
25
+    @Ignore("Remove to run test")
26
     @Test
26
     @Test
27
     public void hourRollsOver() {
27
     public void hourRollsOver() {
28
         assertEquals("01:00", new Clock(25, 0).toString());
28
         assertEquals("01:00", new Clock(25, 0).toString());
29
     }
29
     }
30
 
30
 
31
-    @Ignore
31
+    @Ignore("Remove to run test")
32
     @Test
32
     @Test
33
     public void hourRollsOverContinuously() {
33
     public void hourRollsOverContinuously() {
34
         assertEquals("04:00", new Clock(100, 0).toString());
34
         assertEquals("04:00", new Clock(100, 0).toString());
35
     }
35
     }
36
 
36
 
37
-    @Ignore
37
+    @Ignore("Remove to run test")
38
     @Test
38
     @Test
39
     public void sixtyMinutesIsNextHour() {
39
     public void sixtyMinutesIsNextHour() {
40
         assertEquals("02:00", new Clock(1, 60).toString());
40
         assertEquals("02:00", new Clock(1, 60).toString());
41
     }
41
     }
42
 
42
 
43
-    @Ignore
43
+    @Ignore("Remove to run test")
44
     @Test
44
     @Test
45
     public void minutesRollOver() {
45
     public void minutesRollOver() {
46
         assertEquals("02:40", new Clock(0, 160).toString());
46
         assertEquals("02:40", new Clock(0, 160).toString());
47
     }
47
     }
48
 
48
 
49
-    @Ignore
49
+    @Ignore("Remove to run test")
50
     @Test
50
     @Test
51
     public void minutesRollOverContinuously() {
51
     public void minutesRollOverContinuously() {
52
         assertEquals("04:43", new Clock(0, 1723).toString());
52
         assertEquals("04:43", new Clock(0, 1723).toString());
53
     }
53
     }
54
 
54
 
55
-    @Ignore
55
+    @Ignore("Remove to run test")
56
     @Test
56
     @Test
57
     public void hourAndMinutesRollOver() {
57
     public void hourAndMinutesRollOver() {
58
         assertEquals("03:40", new Clock(25, 160).toString());
58
         assertEquals("03:40", new Clock(25, 160).toString());
59
     }
59
     }
60
 
60
 
61
-    @Ignore
61
+    @Ignore("Remove to run test")
62
     @Test
62
     @Test
63
     public void hourAndMinutesRollOverContinuously() {
63
     public void hourAndMinutesRollOverContinuously() {
64
         assertEquals("11:01", new Clock(201, 3001).toString());
64
         assertEquals("11:01", new Clock(201, 3001).toString());
65
     }
65
     }
66
 
66
 
67
-    @Ignore
67
+    @Ignore("Remove to run test")
68
     @Test
68
     @Test
69
     public void hourAndMinutesRollOverToExactlyMidnight() {
69
     public void hourAndMinutesRollOverToExactlyMidnight() {
70
         assertEquals("00:00", new Clock(72, 8640).toString());
70
         assertEquals("00:00", new Clock(72, 8640).toString());
71
     }
71
     }
72
 
72
 
73
-    @Ignore
73
+    @Ignore("Remove to run test")
74
     @Test
74
     @Test
75
     public void negativeHour() {
75
     public void negativeHour() {
76
         assertEquals("23:15", new Clock(-1, 15).toString());
76
         assertEquals("23:15", new Clock(-1, 15).toString());
77
     }
77
     }
78
 
78
 
79
-    @Ignore
79
+    @Ignore("Remove to run test")
80
     @Test
80
     @Test
81
     public void negativeHourRollsOver() {
81
     public void negativeHourRollsOver() {
82
         assertEquals("23:00", new Clock(-25, 0).toString());
82
         assertEquals("23:00", new Clock(-25, 0).toString());
83
     }
83
     }
84
 
84
 
85
-    @Ignore
85
+    @Ignore("Remove to run test")
86
     @Test
86
     @Test
87
     public void negativeHourRollsOverContinuously() {
87
     public void negativeHourRollsOverContinuously() {
88
         assertEquals("05:00", new Clock(-91, 0).toString());
88
         assertEquals("05:00", new Clock(-91, 0).toString());
89
     }
89
     }
90
 
90
 
91
-    @Ignore
91
+    @Ignore("Remove to run test")
92
     @Test
92
     @Test
93
     public void negativeMinutes() {
93
     public void negativeMinutes() {
94
         assertEquals("00:20", new Clock(1, -40).toString());
94
         assertEquals("00:20", new Clock(1, -40).toString());
95
     }
95
     }
96
 
96
 
97
-    @Ignore
97
+    @Ignore("Remove to run test")
98
     @Test
98
     @Test
99
     public void negativeMinutesRollOver() {
99
     public void negativeMinutesRollOver() {
100
         assertEquals("22:20", new Clock(1, -160).toString());
100
         assertEquals("22:20", new Clock(1, -160).toString());
101
     }
101
     }
102
 
102
 
103
-    @Ignore
103
+    @Ignore("Remove to run test")
104
     @Test
104
     @Test
105
     public void negativeMinutesRollOverContinuously() {
105
     public void negativeMinutesRollOverContinuously() {
106
         assertEquals("16:40", new Clock(1, -4820).toString());
106
         assertEquals("16:40", new Clock(1, -4820).toString());
107
     }
107
     }
108
 
108
 
109
-    @Ignore
109
+    @Ignore("Remove to run test")
110
     @Test
110
     @Test
111
     public void negativeHourAndMinutesBothRollOver() {
111
     public void negativeHourAndMinutesBothRollOver() {
112
         assertEquals("20:20", new Clock(-25, -160).toString());
112
         assertEquals("20:20", new Clock(-25, -160).toString());
113
     }
113
     }
114
 
114
 
115
-    @Ignore
115
+    @Ignore("Remove to run test")
116
     @Test
116
     @Test
117
     public void negativeHourAndMinutesBothRollOverContinuously() {
117
     public void negativeHourAndMinutesBothRollOverContinuously() {
118
         assertEquals("22:10", new Clock(-121, -5810).toString());
118
         assertEquals("22:10", new Clock(-121, -5810).toString());

+ 15
- 15
exercises/clock/src/test/java/ClockEqualTest.java 查看文件

6
 
6
 
7
 public class ClockEqualTest {
7
 public class ClockEqualTest {
8
 
8
 
9
-    @Ignore
9
+    @Ignore("Remove to run test")
10
     @Test
10
     @Test
11
     public void clocksWithSameTimeAreEqual() {
11
     public void clocksWithSameTimeAreEqual() {
12
         assertTrue(new Clock(15, 37).equals(new Clock(15, 37)));
12
         assertTrue(new Clock(15, 37).equals(new Clock(15, 37)));
13
     }
13
     }
14
 
14
 
15
-    @Ignore
15
+    @Ignore("Remove to run test")
16
     @Test
16
     @Test
17
     public void clocksAMinuteApartAreNotEqual() {
17
     public void clocksAMinuteApartAreNotEqual() {
18
         assertFalse(new Clock(15, 36).equals(new Clock(15, 37)));
18
         assertFalse(new Clock(15, 36).equals(new Clock(15, 37)));
19
     }
19
     }
20
 
20
 
21
-    @Ignore
21
+    @Ignore("Remove to run test")
22
     @Test
22
     @Test
23
     public void clocksAnHourApartAreNotEqual() {
23
     public void clocksAnHourApartAreNotEqual() {
24
         assertFalse(new Clock(14, 37).equals(new Clock(15, 37)));
24
         assertFalse(new Clock(14, 37).equals(new Clock(15, 37)));
25
     }
25
     }
26
 
26
 
27
-    @Ignore
27
+    @Ignore("Remove to run test")
28
     @Test
28
     @Test
29
     public void clocksWithHourOverflow() {
29
     public void clocksWithHourOverflow() {
30
         assertTrue(new Clock(10, 37).equals(new Clock(34, 37)));
30
         assertTrue(new Clock(10, 37).equals(new Clock(34, 37)));
31
     }
31
     }
32
 
32
 
33
-    @Ignore
33
+    @Ignore("Remove to run test")
34
     @Test
34
     @Test
35
     public void clocksWithHourOverflowBySeveralDays() {
35
     public void clocksWithHourOverflowBySeveralDays() {
36
         assertTrue(new Clock(3, 11).equals(new Clock(99, 11)));
36
         assertTrue(new Clock(3, 11).equals(new Clock(99, 11)));
37
     }
37
     }
38
 
38
 
39
-    @Ignore
39
+    @Ignore("Remove to run test")
40
     @Test
40
     @Test
41
     public void clocksWithNegateHour() {
41
     public void clocksWithNegateHour() {
42
         assertTrue(new Clock(22, 40).equals(new Clock(-2, 40)));
42
         assertTrue(new Clock(22, 40).equals(new Clock(-2, 40)));
43
     }
43
     }
44
 
44
 
45
-    @Ignore
45
+    @Ignore("Remove to run test")
46
     @Test
46
     @Test
47
     public void clocksWithNegativeHourThatWraps() {
47
     public void clocksWithNegativeHourThatWraps() {
48
         assertTrue(new Clock(17, 3).equals(new Clock(-31, 3)));
48
         assertTrue(new Clock(17, 3).equals(new Clock(-31, 3)));
49
     }
49
     }
50
 
50
 
51
-    @Ignore
51
+    @Ignore("Remove to run test")
52
     @Test
52
     @Test
53
     public void clocksWithNegativeHourThatWrapsMultipleTimes() {
53
     public void clocksWithNegativeHourThatWrapsMultipleTimes() {
54
         assertTrue(new Clock(13, 49).equals(new Clock(-83, 49)));
54
         assertTrue(new Clock(13, 49).equals(new Clock(-83, 49)));
55
     }
55
     }
56
 
56
 
57
-    @Ignore
57
+    @Ignore("Remove to run test")
58
     @Test
58
     @Test
59
     public void clocksWithMinuteOverflow() {
59
     public void clocksWithMinuteOverflow() {
60
         assertTrue(new Clock(0, 1).equals(new Clock(0, 1441)));
60
         assertTrue(new Clock(0, 1).equals(new Clock(0, 1441)));
61
     }
61
     }
62
 
62
 
63
-    @Ignore
63
+    @Ignore("Remove to run test")
64
     @Test
64
     @Test
65
     public void clocksWithMinuteOverflowBySeveralDays() {
65
     public void clocksWithMinuteOverflowBySeveralDays() {
66
         assertTrue(new Clock(2, 2).equals(new Clock(2, 4322)));
66
         assertTrue(new Clock(2, 2).equals(new Clock(2, 4322)));
67
     }
67
     }
68
 
68
 
69
-    @Ignore
69
+    @Ignore("Remove to run test")
70
     @Test
70
     @Test
71
     public void clocksWithNegativeMinutes() {
71
     public void clocksWithNegativeMinutes() {
72
         assertTrue(new Clock(2, 40).equals(new Clock(3, -20)));
72
         assertTrue(new Clock(2, 40).equals(new Clock(3, -20)));
73
     }
73
     }
74
 
74
 
75
-    @Ignore
75
+    @Ignore("Remove to run test")
76
     @Test
76
     @Test
77
     public void clocksWithNegativeMinutesThatWraps() {
77
     public void clocksWithNegativeMinutesThatWraps() {
78
         assertTrue(new Clock(4, 10).equals(new Clock(5, -1490)));
78
         assertTrue(new Clock(4, 10).equals(new Clock(5, -1490)));
79
     }
79
     }
80
 
80
 
81
-    @Ignore
81
+    @Ignore("Remove to run test")
82
     @Test
82
     @Test
83
     public void clocksWithNegativeMinutesThatWrapsMultipleTimes() {
83
     public void clocksWithNegativeMinutesThatWrapsMultipleTimes() {
84
         assertTrue(new Clock(6, 15).equals(new Clock(6, -4305)));
84
         assertTrue(new Clock(6, 15).equals(new Clock(6, -4305)));
85
     }
85
     }
86
 
86
 
87
-    @Ignore
87
+    @Ignore("Remove to run test")
88
     @Test
88
     @Test
89
     public void clocksWithNegativeHoursAndMinutes() {
89
     public void clocksWithNegativeHoursAndMinutes() {
90
         assertTrue(new Clock(7, 32).equals(new Clock(-12, -268)));
90
         assertTrue(new Clock(7, 32).equals(new Clock(-12, -268)));
91
     }
91
     }
92
 
92
 
93
-    @Ignore
93
+    @Ignore("Remove to run test")
94
     @Test
94
     @Test
95
     public void clocksWithNegativeHoursAndMinutesThatWrap() {
95
     public void clocksWithNegativeHoursAndMinutesThatWrap() {
96
         assertTrue(new Clock(18, 7).equals(new Clock(-54, -11513)));
96
         assertTrue(new Clock(18, 7).equals(new Clock(-54, -11513)));