Skip to content

Commit b9b1498

Browse files
committed
🔨 Validations de tous les tests PlanningTest
1 parent c0935a1 commit b9b1498

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/main/java/edt/umontp/fr/Groupe.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,11 @@ private boolean possedeGroupeParent() {
287287
* @see Groupe#groupeParent
288288
* @see Groupe#possedeGroupeParent()
289289
*/
290-
public boolean estContenuDans(Groupe autreGroupe) {
291-
return autreGroupe == this || (possedeGroupeParent() && groupeParent.estContenuDans(autreGroupe));
290+
public boolean estContenuDans(Groupe... autreGroupes) {
291+
for (Groupe aGroupe : autreGroupes)
292+
if (aGroupe == this || (possedeGroupeParent() && groupeParent.estContenuDans(aGroupe)))
293+
return true;
294+
return false;
292295
}
293296

294297
/**

src/main/java/edt/umontp/fr/Planning.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public Planning getPlanningOf(LocalDate date, Groupe groupe) {
119119
*/
120120
@Override
121121
public Planning getPlanningOf(Groupe groupe) {
122-
return new Planning(cours.stream().filter(x -> Groupe.unGroupeDeGroupesEstContenuDans(x.getGroupes(), groupe))
123-
.collect(Collectors.toList()));
122+
return new Planning(
123+
cours.stream().filter(c -> groupe.estContenuDans(c.getGroupes())).collect(Collectors.toList()));
124124
}
125125

126126
/**

0 commit comments

Comments
 (0)