-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathLanguageUnitTest.java
87 lines (62 loc) · 2.02 KB
/
LanguageUnitTest.java
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
package com.crevation.nglocaltime;
import com.crevation.nglocaltime.efik.Efik;
import com.crevation.nglocaltime.english.English;
import com.crevation.nglocaltime.hausa.Hausa;
import com.crevation.nglocaltime.igbo.Igbo;
import com.crevation.nglocaltime.yoruba.Yoruba;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
/**
* LanguageTime library unit test, which will execute on the development machine (host).
*
*/
public class LanguageUnitTest {
Time yoruba;
Time igbo;
Time hausa;
Time english;
Time efik;
@Before
public void setupTime() {
yoruba = new Yoruba();
igbo = new Igbo();
hausa = new Hausa();
english = new English();
efik = new Efik();
}
@Test
public void showCorrectOutput() {
System.out.println(yoruba.getTime("4:00"));
System.out.println(igbo.getTime("4:15"));
System.out.println(hausa.getTime("4:15"));
System.out.println(english.getTime("4:15"));
System.out.println(efik.getTime("4:15"));
System.out.println(efik.getTime("45"));
}
@Test
public void yoruba_isCorrect() throws Exception {
assertEquals(yoruba.getTime("4:00"), "Aago Merin");
}
@Test
public void yoruba_notCorrect() throws Exception {
assertNotEquals("This input is incorrect",yoruba.getTime("4:00"), "Aago Merinla");
}
@Test
public void igbo_isCorrect() throws Exception {
assertEquals(igbo.getTime("4:15"), "O ji nkeji Iri na ise gafee Elekere Ano");
}
@Test
public void hausa_isCorrect() throws Exception {
assertEquals(hausa.getTime("4:15"), "Karfe Hudu Da Kwata");
}
@Test
public void english_isCorrect() throws Exception {
assertEquals(english.getTime("4:15"), "Quarter past Four");
}
@Test
public void efik_isCorrect() throws Exception {
assertEquals(efik.getTime("4:15"), "Amia Inan ebe ke minute Efut");
}
}