forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClockCreationTest.java
More file actions
120 lines (99 loc) · 3.04 KB
/
ClockCreationTest.java
File metadata and controls
120 lines (99 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ClockCreationTest {
@Test
public void canPrintTimeOnTheHour() {
assertEquals("08:00", new Clock(8, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void canPrintTimeWithMinutes() {
assertEquals("11:09", new Clock(11, 9).toString());
}
@Ignore("Remove to run test")
@Test
public void midnightPrintsAsZero() {
assertEquals("00:00", new Clock(24, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void hourRollsOver() {
assertEquals("01:00", new Clock(25, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void hourRollsOverContinuously() {
assertEquals("04:00", new Clock(100, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void sixtyMinutesIsNextHour() {
assertEquals("02:00", new Clock(1, 60).toString());
}
@Ignore("Remove to run test")
@Test
public void minutesRollOver() {
assertEquals("02:40", new Clock(0, 160).toString());
}
@Ignore("Remove to run test")
@Test
public void minutesRollOverContinuously() {
assertEquals("04:43", new Clock(0, 1723).toString());
}
@Ignore("Remove to run test")
@Test
public void hourAndMinutesRollOver() {
assertEquals("03:40", new Clock(25, 160).toString());
}
@Ignore("Remove to run test")
@Test
public void hourAndMinutesRollOverContinuously() {
assertEquals("11:01", new Clock(201, 3001).toString());
}
@Ignore("Remove to run test")
@Test
public void hourAndMinutesRollOverToExactlyMidnight() {
assertEquals("00:00", new Clock(72, 8640).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeHour() {
assertEquals("23:15", new Clock(-1, 15).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeHourRollsOver() {
assertEquals("23:00", new Clock(-25, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeHourRollsOverContinuously() {
assertEquals("05:00", new Clock(-91, 0).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeMinutes() {
assertEquals("00:20", new Clock(1, -40).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeMinutesRollOver() {
assertEquals("22:20", new Clock(1, -160).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeMinutesRollOverContinuously() {
assertEquals("16:40", new Clock(1, -4820).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeHourAndMinutesBothRollOver() {
assertEquals("20:20", new Clock(-25, -160).toString());
}
@Ignore("Remove to run test")
@Test
public void negativeHourAndMinutesBothRollOverContinuously() {
assertEquals("22:10", new Clock(-121, -5810).toString());
}
}