-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathProblem6Test.java
More file actions
102 lines (84 loc) · 2.83 KB
/
Problem6Test.java
File metadata and controls
102 lines (84 loc) · 2.83 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
package io.zipcoder;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.theories.suppliers.TestedOn;
public class Problem6Test {
private Problem6 problem;
@Before
public void setUp() {
problem = new Problem6();
}
@Test
public void convertToMilitaryTimeTestOne() {
String expected = "13:30";
String actual = problem.convertToMilitaryTime("1:30 pm");
Assert.assertEquals(expected, actual);
}
@Test
public void convertToMilitaryTimeTestTwo() {
String expected = "01:30";
String actual = problem.convertToMilitaryTime("1:30 am");
Assert.assertEquals(expected, actual);
}
@Test
public void convertToMilitaryTimeTestThree() {
String expected = "14:22";
String actual = problem.convertToMilitaryTime("2:22 pm");
Assert.assertEquals(expected, actual);
}
@Test
public void convertToMilitaryTimeTestFour() {
String expected = "02:22";
String actual = problem.convertToMilitaryTime("2:22 am");
Assert.assertEquals(expected, actual);
}
@Test
public void parseMilitaryHourTest() {
int expected = 13;
int actual = problem.parseMilitaryHour("13:30");
Assert.assertEquals(expected, actual);
}
@Test
public void parseMilitaryMinutesTest() {
int expected = 30;
int actual = problem.parseMilitaryMinutes("13:30");
Assert.assertEquals(expected, actual);
}
@Test
public void convertHourToWordTestONe() {
String expected = "Thirteen";
String actual = problem.convertHourToWord(13);
Assert.assertEquals(expected, actual);
}
@Test
public void convertHourToWordTestTwo() {
String expected = "Twentyfour";
String actual = problem.convertHourToWord(24);
Assert.assertEquals(expected, actual);
}
@Test
public void convertMinuteToWordTestOne() {
String expected = "Seven";
String actual = problem.convertMinuteToWord(7);
Assert.assertEquals(expected, actual);
}
@Test
public void convertMinuteToWordTestTwo() {
String expected = "Fortyone";
String actual = problem.convertMinuteToWord(41);
Assert.assertEquals(expected, actual);
}
@Test
public void convertToMilitaryTimeInWordsTestOne() {
String expected = "Thirteen Hundred and Thirty Hours";
String actual = problem.convertToMilitaryTimeInWords("Thirteen", "Thirty");
Assert.assertEquals(expected, actual);
}
@Test
public void convertToMilitaryTimeInWordsTestTwo() {
String expected = "Fourteen Hundred and Twentytwo Hours";
String actual = problem.convertToMilitaryTimeInWords("Fourteen", "Twentytwo");
Assert.assertEquals(expected, actual);
}
}