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
19ea9300
Commit
19ea9300
authored
May 17, 2019
by
Gaetan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modification des tests unitaires
parent
51118632
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
25 deletions
+27
-25
geometry.iml
.idea/geometry.iml
+3
-2
GarageTest.java
garage/src/tests/GarageTest.java
+0
-0
TestBenchTest.java
garage/src/tests/TestBenchTest.java
+0
-0
TestEngine.java
garage/src/tests/TestEngine.java
+0
-0
TestVehicle.java
garage/src/tests/TestVehicle.java
+9
-0
Vehicle.java
garage/src/vehicle/Vehicle.java
+15
-21
TestVehicle.java
garage/test/TestVehicle.java
+0
-2
No files found.
.idea/geometry.iml
View file @
19ea9300
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<content
url=
"file://$MODULE_DIR$"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/garage/test"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/garage/test"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/garage/src"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/garage/src"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/garage/src/tests"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/.gradle"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/.gradle"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build"
/>
</content>
</content>
...
@@ -13,8 +14,8 @@
...
@@ -13,8 +14,8 @@
<orderEntry
type=
"module-library"
scope=
"TEST"
>
<orderEntry
type=
"module-library"
scope=
"TEST"
>
<library
name=
"JUnit4"
>
<library
name=
"JUnit4"
>
<CLASSES>
<CLASSES>
<root
url=
"jar://$
USER_HOME$/.m2/repository
/junit/junit/4.12/junit-4.12.jar!/"
/>
<root
url=
"jar://$
MAVEN_REPOSITORY$
/junit/junit/4.12/junit-4.12.jar!/"
/>
<root
url=
"jar://$
USER_HOME$/.m2/repository
/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/"
/>
<root
url=
"jar://$
MAVEN_REPOSITORY$
/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/"
/>
</CLASSES>
</CLASSES>
<JAVADOC
/>
<JAVADOC
/>
<SOURCES
/>
<SOURCES
/>
...
...
garage/
test
/GarageTest.java
→
garage/
src/tests
/GarageTest.java
View file @
19ea9300
File moved
garage/
test
/TestBenchTest.java
→
garage/
src/tests
/TestBenchTest.java
View file @
19ea9300
File moved
garage/
test
/TestEngine.java
→
garage/
src/tests
/TestEngine.java
View file @
19ea9300
File moved
garage/src/tests/TestVehicle.java
0 → 100644
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
{
}
garage/src/vehicle/Vehicle.java
View file @
19ea9300
...
@@ -128,28 +128,10 @@ public class Vehicle {
...
@@ -128,28 +128,10 @@ public class Vehicle {
return
options
;
return
options
;
}
}
// DISPLAY /////////////////////////////////////////////////////////////////////////////////////////////////////////
public
VehicleBrand
getBrand
(){
public
void
displayVehicleInformation
(){
return
this
.
brand
;
// Clear screen
System
.
out
.
print
(
"\033[H\033[2J"
);
System
.
out
.
flush
();
System
.
out
.
println
(
"|------------------------------------------------------------------|"
);
System
.
out
.
println
(
"| VEHICULE INFORMATION |"
);
System
.
out
.
println
(
"|------------------------------------------------------------------|"
);
System
.
out
.
println
(
" BRAND: "
+
brand
+
" MODEL: "
+
name
+
" PRICE: "
+
price
);
System
.
out
.
println
(
"|-----------------------------------------------------------------|"
);
}
}
// Get the brand of the car
public
VehicleBrand
getBrand
(){
return
this
.
brand
;}
// Get the options of the car
// public List<vehicle.part.option> getOptions()
// Get the price
public
double
getPrice
(
List
<
Option
>
options
){
public
double
getPrice
(
List
<
Option
>
options
){
int
index
=
0
;
int
index
=
0
;
double
price
=
0
;
double
price
=
0
;
...
@@ -158,11 +140,23 @@ public class Vehicle {
...
@@ -158,11 +140,23 @@ public class Vehicle {
return
price
;
return
price
;
}
}
else
{
else
{
// price = options.Stream.forEach(o -> o.getPrice);
price
=
options
.
stream
().
collect
(
Collectors
.
summingDouble
(
Option:
:
getPrice
));
price
=
options
.
stream
().
collect
(
Collectors
.
summingDouble
(
Option:
:
getPrice
));
}
}
return
price
;
return
price
;
}
// DISPLAY /////////////////////////////////////////////////////////////////////////////////////////////////////////
public
void
displayVehicleInformation
(){
// Clear screen
System
.
out
.
print
(
"\033[H\033[2J"
);
System
.
out
.
flush
();
System
.
out
.
println
(
"|------------------------------------------------------------------|"
);
System
.
out
.
println
(
"| VEHICULE INFORMATION |"
);
System
.
out
.
println
(
"|------------------------------------------------------------------|"
);
System
.
out
.
println
(
" BRAND: "
+
brand
+
" MODEL: "
+
name
+
" PRICE: "
+
price
);
System
.
out
.
println
(
"|-----------------------------------------------------------------|"
);
}
}
}
}
\ No newline at end of file
garage/test/TestVehicle.java
deleted
100644 → 0
View file @
51118632
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