Repository navigation
Expand file tree
/
Copy pathSpaceAgeTest.java
More file actions
88 lines (66 loc) · 2.07 KB
/
Copy pathSpaceAgeTest.java
File metadata and controls
88 lines (66 loc) · 2.07 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
import org.junit.Test;
import org.junit.Ignore;
import static org.junit.Assert.assertEquals;
public class SpaceAgeTest {
private static final double MAXIMUM_DELTA = 1E-02;
@Test
public void ageInSeconds() {
SpaceAge age = new SpaceAge(1000000);
assertEquals(1000000, age.getSeconds(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnEarth() {
SpaceAge age = new SpaceAge(1000000000);
assertEquals(31.69, age.onEarth(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnMercury() {
SpaceAge age = new SpaceAge(2134835688);
assertEquals(67.65, age.onEarth(), MAXIMUM_DELTA);
assertEquals(280.88, age.onMercury(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnVenus() {
SpaceAge age = new SpaceAge(189839836);
assertEquals(6.02, age.onEarth(), MAXIMUM_DELTA);
assertEquals(9.78, age.onVenus(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnMars() {
SpaceAge age = new SpaceAge(2329871239L);
assertEquals(73.83, age.onEarth(), MAXIMUM_DELTA);
assertEquals(39.25, age.onMars(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnJupiter() {
SpaceAge age = new SpaceAge(901876382);
assertEquals(28.58, age.onEarth(), MAXIMUM_DELTA);
assertEquals(2.41, age.onJupiter(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnSaturn() {
SpaceAge age = new SpaceAge(3000000000L);
assertEquals(95.06, age.onEarth(), MAXIMUM_DELTA);
assertEquals(3.23, age.onSaturn(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnUranus() {
SpaceAge age = new SpaceAge(3210123456L);
assertEquals(101.72, age.onEarth(), MAXIMUM_DELTA);
assertEquals(1.21, age.onUranus(), MAXIMUM_DELTA);
}
@Ignore
@Test
public void ageOnNeptune() {
SpaceAge age = new SpaceAge(8210123456L);
assertEquals(260.16, age.onEarth(), MAXIMUM_DELTA);
assertEquals(1.58, age.onNeptune(), MAXIMUM_DELTA);
}
}