-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathVehicleTest.java
More file actions
63 lines (53 loc) · 1.76 KB
/
Copy pathVehicleTest.java
File metadata and controls
63 lines (53 loc) · 1.76 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
import AbstractAndInterface.Motorcycle;
import AbstractAndInterface.Plane;
import AbstractAndInterface.Vehicle;
import org.junit.Test;
import static org.junit.Assert.*;
public class VehicleTest {
private Vehicle motorrad = new Motorcycle(1,"Vi-001","Honcool",100);
private Vehicle plane = new Plane(1,"Bow-001","NokLionAir",1000);
public VehicleTest() {
}
@Test
public void checkMotorrad1() {
boolean expectResult = false;
boolean result=motorrad.checkConsumeEnergy(900);
assertEquals(expectResult, result);
}
@Test
public void checkMotorrad2() {
boolean expectResult = false;
boolean result=motorrad.checkConsumeEnergy(833.5);
assertEquals(expectResult, result);
}
@Test
public void checkMotorrad3() {
boolean expectResult = true;
boolean result=motorrad.checkConsumeEnergy(833);
assertEquals(expectResult, result);
}
@Test
public void checkMotorrad4() {
boolean expectResult = true;
boolean result=motorrad.checkConsumeEnergy(800);
assertEquals(expectResult, result);
}
@Test
public void checkPlane1() {
boolean expectResult = false;
boolean result=plane.checkConsumeEnergy(20000);
assertEquals(expectResult, result);
}
@Test
public void checkPlane2() {
boolean expectResult = true;
boolean result=plane.checkConsumeEnergy(10000);
assertEquals(expectResult, result);
}
@Test
public void checkPlane3() {
boolean expectResult = true;
boolean result=plane.checkConsumeEnergy(9000);
assertEquals(expectResult, result);
}
}