Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tok-chef
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
Antoine HAZEBROUCK
tok-chef
Commits
3dd8e673
Commit
3dd8e673
authored
Sep 13, 2024
by
Antoine Hazebrouck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plat 100% bios
parent
46d9a61d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
0 deletions
+48
-0
Plat.java
src/main/java/imt/ingredients/Plat.java
+7
-0
PlatTest.java
src/test/java/imt/ingredients/PlatTest.java
+25
-0
ChefTest.java
src/test/java/imt/personnes/ChefTest.java
+16
-0
No files found.
src/main/java/imt/ingredients/Plat.java
View file @
3dd8e673
package
imt
.
ingredients
;
package
imt
.
ingredients
;
import
java.util.stream.Stream
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
@EqualsAndHashCode
@EqualsAndHashCode
...
@@ -47,4 +49,9 @@ public class Plat {
...
@@ -47,4 +49,9 @@ public class Plat {
return
"Plat [idPlat="
+
idPlat
+
", nomPlat="
+
nomPlat
+
", ingredients="
+
ingredientStr
.
toString
()
+
"]"
;
return
"Plat [idPlat="
+
idPlat
+
", nomPlat="
+
nomPlat
+
", ingredients="
+
ingredientStr
.
toString
()
+
"]"
;
}
}
public
boolean
isBio
()
{
return
Stream
.
of
(
ingredients
)
.
allMatch
(
ingredient
->
ingredient
.
isBio
());
}
}
}
src/test/java/imt/ingredients/PlatTest.java
0 → 100644
View file @
3dd8e673
package
imt
.
ingredients
;
import
static
imt
.
ingredients
.
IngredientTest
.
AUTRE
;
import
static
imt
.
ingredients
.
IngredientTest
.
OIGNON
;
import
static
imt
.
ingredients
.
IngredientTest
.
STEAK
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
org.junit.jupiter.api.Test
;
public
class
PlatTest
{
@Test
void
plat_entierement_bio
()
{
Plat
platBio
=
new
Plat
(
1
,
"plat1"
,
new
Ingredient
[]
{
STEAK
,
OIGNON
});
assertThat
(
platBio
.
isBio
()).
isTrue
();
Plat
platNonBio
=
new
Plat
(
2
,
"plat2"
,
new
Ingredient
[]
{
STEAK
,
OIGNON
,
AUTRE
});
assertThat
(
platNonBio
.
isBio
()).
isFalse
();
}
}
src/test/java/imt/personnes/ChefTest.java
0 → 100644
View file @
3dd8e673
package
imt
.
personnes
;
import
org.junit.jupiter.api.Test
;
import
imt.ingredients.Ingredient
;
import
imt.ingredients.Legume
;
import
imt.ingredients.Plat
;
public
class
ChefTest
{
// @Test
// void plat_connus_d_un_chef_par_calories() {
// Plat plat1 = new Plat(1, "plat1", new Ingredient[] {
// new Legume(1, "poivron", 10, true);
// });
// }
}
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