|
@@ -0,0 +1,74 @@
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+import static org.junit.Assert.*;
|
|
4
|
+import org.junit.After;
|
|
5
|
+import org.junit.Before;
|
|
6
|
+import org.junit.Test;
|
|
7
|
+
|
|
8
|
+/**
|
|
9
|
+ * The test class SwitchDisplayTest.
|
|
10
|
+ *
|
|
11
|
+ * @author (your name)
|
|
12
|
+ * @version (a version number or a date)
|
|
13
|
+ */
|
|
14
|
+public class SwitchDisplayTest
|
|
15
|
+{
|
|
16
|
+ /**
|
|
17
|
+ * Default constructor for test class SwitchDisplayTest
|
|
18
|
+ */
|
|
19
|
+ public SwitchDisplayTest()
|
|
20
|
+ {
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ /**
|
|
24
|
+ * Sets up the test fixture.
|
|
25
|
+ *
|
|
26
|
+ * Called before every test case method.
|
|
27
|
+ */
|
|
28
|
+ @Before
|
|
29
|
+ public void setUp()
|
|
30
|
+ {
|
|
31
|
+ }
|
|
32
|
+
|
|
33
|
+ /**
|
|
34
|
+ * Tears down the test fixture.
|
|
35
|
+ *
|
|
36
|
+ * Called after every test case method.
|
|
37
|
+ */
|
|
38
|
+ @After
|
|
39
|
+ public void tearDown()
|
|
40
|
+ {
|
|
41
|
+ }
|
|
42
|
+
|
|
43
|
+ @Test
|
|
44
|
+ public void toBinary()
|
|
45
|
+ {
|
|
46
|
+ SwitchDisplay switchDi1 = new SwitchDisplay();
|
|
47
|
+ assertEquals("101101", switchDi1.toBinary(45));
|
|
48
|
+ }
|
|
49
|
+
|
|
50
|
+ @Test
|
|
51
|
+ public void toOctal()
|
|
52
|
+ {
|
|
53
|
+ SwitchDisplay switchDi1 = new SwitchDisplay();
|
|
54
|
+ assertEquals("55", switchDi1.toOctal(45));
|
|
55
|
+ }
|
|
56
|
+
|
|
57
|
+ @Test
|
|
58
|
+ public void toHexa()
|
|
59
|
+ {
|
|
60
|
+ SwitchDisplay switchDi1 = new SwitchDisplay();
|
|
61
|
+ assertEquals("2d", switchDi1.toHexa(45));
|
|
62
|
+ }
|
|
63
|
+
|
|
64
|
+ @Test
|
|
65
|
+ public void toDecimal()
|
|
66
|
+ {
|
|
67
|
+ SwitchDisplay switchDi1 = new SwitchDisplay();
|
|
68
|
+ assertEquals("45", switchDi1.toDecimal(45));
|
|
69
|
+ }
|
|
70
|
+}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|