-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthquakeTest.java
More file actions
48 lines (39 loc) · 1.14 KB
/
Copy pathEarthquakeTest.java
File metadata and controls
48 lines (39 loc) · 1.14 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
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
/**
* The test class for Earthquake class.
*/
class EarthquakeTest {
private double magnitudeTest = 8.6;
private double latitudeTest = 34.5;
private double longitudeTest = 55.3;
private int earthquakeEventYearTest = 1981;
public Earthquake createEarthquake()
{
return new Earthquake(magnitudeTest, latitudeTest, longitudeTest, earthquakeEventYearTest);
}
@Test
void getMagnitude()
{
Earthquake earthquake = createEarthquake();
assertEquals(magnitudeTest, earthquake.getMagnitude());
}
@Test
void getLatitude()
{
Earthquake earthquake = createEarthquake();
assertEquals(latitudeTest, earthquake.getLatitude());
}
@Test
void getLongitude()
{
Earthquake earthquake = createEarthquake();
assertEquals(longitudeTest, earthquake.getLongitude());
}
@Test
void getEarthquakeEventYear()
{
Earthquake earthquake = createEarthquake();
assertEquals(earthquakeEventYearTest, earthquake.getEarthquakeEventYear());
}
}