Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
POIGNONNEC
Projet GORDYJAN_BAGNOLY_GARCIA_POIGNONNEC
Commits
e17d5c7f
Commit
e17d5c7f
authored
May 17, 2019
by
Gaetan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modification des tests unitaires
parent
19ea9300
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
46 deletions
+23
-46
GarageTest.java
garage/src/tests/GarageTest.java
+0
-14
TestBenchTest.java
garage/src/tests/TestBenchTest.java
+23
-21
TestEngine.java
garage/src/tests/TestEngine.java
+0
-2
TestVehicle.java
garage/src/tests/TestVehicle.java
+0
-9
No files found.
garage/src/tests/GarageTest.java
deleted
100644 → 0
View file @
19ea9300
import
garage.Garage
;
import
org.junit.Before
;
import
org.junit.Test
;
import
static
junit
.
framework
.
TestCase
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertNull
;
public
class
GarageTest
{
private
Garage
garage
;
}
garage/src/tests/TestBenchTest.java
View file @
e17d5c7f
package
test
;
import
garage.ExecutionFailedException
;
import
garage.Task
;
import
garage.TestBench
;
...
...
@@ -34,72 +36,72 @@ public class TestBenchTest {
@Test
public
void
addVehicleTest
(){
assertNull
(
testBench
.
getVehicle
());
Assert
.
assertNull
(
testBench
.
getVehicle
());
testBench
.
addVehicle
(
fiat500
);
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
TestCase
.
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
}
@Test
public
void
addVehicleImpossibleTest
(){
assertNull
(
testBench
.
getVehicle
());
Assert
.
assertNull
(
testBench
.
getVehicle
());
testBench
.
addVehicle
(
fiat500
);
testBench
.
addVehicle
(
peugeot5008
);
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
TestCase
.
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
}
@Test
public
void
removeVehicleTest
(){
testBench
.
addVehicle
(
fiat500
);
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
TestCase
.
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
testBench
.
removeVehicle
();
assertNull
(
testBench
.
getVehicle
());
Assert
.
assertNull
(
testBench
.
getVehicle
());
}
@Test
public
void
removeVehicleImpossibleTest
(){
testBench
.
removeVehicle
();
assertNull
(
testBench
.
getVehicle
());
Assert
.
assertNull
(
testBench
.
getVehicle
());
}
@Test
public
void
swapVehicleTest
(){
testBench
.
addVehicle
(
fiat500
);
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
TestCase
.
assertEquals
(
fiat500
,
testBench
.
getVehicle
());
Vehicle
swapped
=
testBench
.
swapVehicle
(
peugeot5008
);
assertEquals
(
fiat500
,
swapped
);
assertEquals
(
peugeot5008
,
testBench
.
getVehicle
());
TestCase
.
assertEquals
(
fiat500
,
swapped
);
TestCase
.
assertEquals
(
peugeot5008
,
testBench
.
getVehicle
());
}
@Test
public
void
swapVehicleImpossibleTest
(){
Vehicle
swapped
=
testBench
.
swapVehicle
(
peugeot5008
);
assertNull
(
swapped
);
assertNull
(
testBench
.
getVehicle
());
Assert
.
assertNull
(
swapped
);
Assert
.
assertNull
(
testBench
.
getVehicle
());
}
@Test
public
void
addTaskTest
(){
assertEquals
(
0
,
testBench
.
getTasks
().
size
());
TestCase
.
assertEquals
(
0
,
testBench
.
getTasks
().
size
());
testBench
.
addTask
(
task
);
assertEquals
(
1
,
testBench
.
getTasks
().
size
());
assertTrue
(
testBench
.
getTasks
().
contains
(
task
));
TestCase
.
assertEquals
(
1
,
testBench
.
getTasks
().
size
());
TestCase
.
assertTrue
(
testBench
.
getTasks
().
contains
(
task
));
}
@Test
public
void
removeTaskTest
(){
testBench
.
addTask
(
task
);
assertEquals
(
1
,
testBench
.
getTasks
().
size
());
TestCase
.
assertEquals
(
1
,
testBench
.
getTasks
().
size
());
testBench
.
removeTask
(
task
);
assertEquals
(
0
,
testBench
.
getTasks
().
size
());
TestCase
.
assertEquals
(
0
,
testBench
.
getTasks
().
size
());
}
@Test
public
void
runTest
(){
testBench
.
addVehicle
(
fiat500
);
testBench
.
addTask
(
task
);
assertEquals
(
0
d
,
fiat500
.
getPedals
().
get
(
0
).
getState
());
TestCase
.
assertEquals
(
0
d
,
fiat500
.
getPedals
().
get
(
0
).
getState
());
testBench
.
run
(
10
);
assertEquals
(
50
d
,
fiat500
.
getPedals
().
get
(
0
).
getState
());
TestCase
.
assertEquals
(
50
d
,
fiat500
.
getPedals
().
get
(
0
).
getState
());
}
@Test
...
...
@@ -119,9 +121,9 @@ public class TestBenchTest {
testBench
.
addTask
(
new
Task
(
fiat500
.
getGearBox
(),
"gearUp"
,
null
,
3
));
testBench
.
addTask
(
new
Task
(
fiat500
.
getPedals
().
get
(
PedalPosition
.
CLUTCH
.
getValue
()),
"setState"
,
Arrays
.
asList
(
0
d
),
4
));
assertEquals
(
Gear
.
NEUTRAL
,
fiat500
.
getGearBox
().
getCurrentGear
());
TestCase
.
assertEquals
(
Gear
.
NEUTRAL
,
fiat500
.
getGearBox
().
getCurrentGear
());
testBench
.
run
(
10
);
assertEquals
(
Gear
.
FIRST
,
fiat500
.
getGearBox
().
getCurrentGear
());
TestCase
.
assertEquals
(
Gear
.
FIRST
,
fiat500
.
getGearBox
().
getCurrentGear
());
}
}
garage/src/tests/TestEngine.java
deleted
100644 → 0
View file @
19ea9300
public
class
TestEngine
{
}
garage/src/tests/TestVehicle.java
deleted
100644 → 0
View file @
19ea9300
import
vehicle.part.option.Aircon
;
import
vehicle.part.option.CareerBars
;
import
vehicle.part.option.Option
;
import
java.util.List
;
public
class
TestVehicle
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment