-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathFormattingTest.java
More file actions
74 lines (65 loc) · 1.77 KB
/
FormattingTest.java
File metadata and controls
74 lines (65 loc) · 1.77 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
package io.zipcoder;
import org.junit.Assert;
import org.junit.Test;
public class FormattingTest {
@Test
public void convertTimeTest(){
//Given
String input = "1:30AM";
String expected = "01:30";
//When
String actual = Formatting.convertTime(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void convertTimeTest2(){
//Given
String input = "1:30PM";
String expected = "13:30";
//When
String actual = Formatting.convertTime(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void changeFormatHundredTest(){
//Given
String input = "01:30";
String expected = "Zero One Hundred";
//When
String actual = Formatting.changeFormatHundred(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void changeFormatHundredTest2(){
//Given
String input = "13:30";
String expected = "Thirteen Hundred";
//When
String actual = Formatting.changeFormatHundred(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void changeFormatHoursTest(){
//Given
String input = "13:03";
String expected = " Zero Three Hours";
//When
String actual = Formatting.changeFormatHours(input);
//Then
Assert.assertEquals(expected, actual);
}
@Test
public void getNewTimeTest() {
//Given
String input = "11:03AM";
String expected = "Eleven Hundred Zero Three Hours";
//When
String actual = Formatting.getNewTime(input);
//Then
Assert.assertEquals(expected, actual);
}
}