-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnitTest.java
55 lines (46 loc) · 1.19 KB
/
UnitTest.java
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
class UnitTest {
public static void main (String[] args) {
ManualTransmission mt;
mt = new ManualTransmission(5);
if (mt.shiftUp()){
System.out.println("shift up no clutch fail");
return;
}
mt = new ManualTransmission(5);
if (mt.shiftDown()){
System.out.println("shift down no clutch fail");
return;
}
mt = new ManualTransmission(5);
mt.clutchDown();
if (!mt.shiftUp()){
System.out.println("shift up with clutch down fail");
return;
}
mt = new ManualTransmission(5);
mt.clutchDown();
if (!mt.shiftTo(5)){
System.out.println("shifting to 5 with clutch down fail");
return;
}
mt = new ManualTransmission(5);
mt.clutchDown();
if (!mt.shiftDown()){
System.out.println("shift down with clutch down fail");
return;
}
mt = new ManualTransmission(5);
mt.clutchDown();
if (!mt.shiftTo(5)) {
System.out.println("shifting to 5 failed with clutch down");
return;
}
mt = new ManualTransmission(5);
mt.clutchDown();
if (mt.shiftTo(8)) {
System.out.println("setGear above total gears failed with clutch down");
return;
}
System.out.println("Success");
}
}