Repository navigation
Expand file tree
/
Copy pathOctalTest.java
More file actions
98 lines (82 loc) · 2.44 KB
/
Copy pathOctalTest.java
File metadata and controls
98 lines (82 loc) · 2.44 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
import org.junit.Test;
import org.junit.Ignore;
import static org.junit.Assert.assertEquals;
public class OctalTest {
@Test
public void testCovertDecimalOneToOctal() {
Octal octal = new Octal("1");
assertEquals(1, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testCovertDecimalTenToOctal() {
Octal octal = new Octal("10");
assertEquals(8, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testCovertDecimalSeventeenToOctal() {
Octal octal = new Octal("17");
assertEquals(15, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testCovertElevenToOctal() {
Octal octal = new Octal("11");
assertEquals(9, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testCovertDecimalElevenWithZeroToOctal() {
Octal octal = new Octal("011");
assertEquals(9, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testThreeDigitDecimalToOctal() {
Octal octal = new Octal("130");
assertEquals(88, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testSmallFourDigitDecimalToOctal() {
Octal octal = new Octal("2047");
assertEquals(1063, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testLargeFourDigitDecimalToOctal() {
Octal octal = new Octal("7777");
assertEquals(4095, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testSevenDigitDecimalToOctal() {
Octal octal = new Octal("1234567");
assertEquals(342391, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testInvalidStringFirst() {
Octal octal = new Octal("carrot");
assertEquals(0, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testInvalidStringSecond() {
Octal octal = new Octal("abc1z");
assertEquals(0, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testInvalidDecimalEight() {
Octal octal = new Octal("8");
assertEquals(0, octal.getDecimal());
}
@Ignore("Remove to run test")
@Test
public void testInvalidNumberNine() {
Octal octal = new Octal("9");
assertEquals(0, octal.getDecimal());
}
}