5 Commits

Author SHA1 Message Date
1b1abeb540 ajout puit correction erreur
Some checks are pending
rock-paper-scissors-jenkins/pipeline/head This commit looks good
rock-paper-scissors-jenkins/pipeline/pr-main Build queued...
2025-11-27 11:42:01 +01:00
e9a0a64625 ajout puit correction erreur
Some checks failed
rock-paper-scissors-jenkins/pipeline/head There was a failure building this commit
2025-11-27 11:39:39 +01:00
417f0ffd7f ajout puit correction erreur
Some checks failed
rock-paper-scissors-jenkins/pipeline/head There was a failure building this commit
2025-11-27 11:33:36 +01:00
cd612bd998 ajout puit correction erreur
Some checks failed
rock-paper-scissors-jenkins/pipeline/head There was a failure building this commit
2025-11-27 11:25:35 +01:00
0944a2db43 ajout puit
Some checks failed
rock-paper-scissors-jenkins/pipeline/head There was a failure building this commit
2025-11-27 11:22:31 +01:00
4 changed files with 13 additions and 8 deletions

View File

@@ -7,8 +7,6 @@ Se rendre sur : https://grond.iut-fbleau.fr/pierront/rock-paper-scissors
Faire un fork Faire un fork
`/!\ ATTENTION NE PRENDRE QUE LA BRANCHE MAIN /!\`
## Créer la VM pour jenkins ## Créer la VM pour jenkins
### Créer la règle pare-feu pour accéder aux ports 8080 et 8081 ### Créer la règle pare-feu pour accéder aux ports 8080 et 8081
Aller dans la section Pare-Feu Aller dans la section Pare-Feu
@@ -119,7 +117,7 @@ Vous devriez voir la page d'accueil de Jenkins
--- ---
## Création d'un pipeline ## Création d'un pipeline
* Aller sur l'accueil Jenkins -> New Item * Aller dans la section Manage Jenkins -> New Item
* Nommer le projet : rock-paper-scissors * Nommer le projet : rock-paper-scissors
* Choisir le type de projet : Multibranch Pipeline * Choisir le type de projet : Multibranch Pipeline
* Cliquer sur OK * Cliquer sur OK
@@ -128,6 +126,7 @@ Vous devriez voir la page d'accueil de Jenkins
* utiliser le jeton gitea-token * utiliser le jeton gitea-token
* owner : _<votre nom d'utilisateur gitea>_ * owner : _<votre nom d'utilisateur gitea>_
* Choisir le projet : rock-paper-scissors * Choisir le projet : rock-paper-scissors
* Choisir le provider : Git
* Choisir le repository : https://grond.iut-fbleau.fr/pierront/rock-paper-scissors.git * Choisir le repository : https://grond.iut-fbleau.fr/pierront/rock-paper-scissors.git
* Cliquer sur Save * Cliquer sur Save

View File

@@ -3,13 +3,15 @@ package fr.iut_fbleau.info.but3.automation.rock_paper_scissors.play.domain;
public enum Move { public enum Move {
ROCK, ROCK,
PAPER, PAPER,
SCISSORS; SCISSORS,
PUIT;
public boolean beats(Move other) { public boolean beats(Move other) {
return switch (this) { return switch (this) {
case ROCK -> other == SCISSORS; case ROCK -> other == SCISSORS;
case PAPER -> other == ROCK; case PAPER -> other == ROCK || other == PUIT;
case SCISSORS -> other == PAPER; case SCISSORS -> other == PAPER;
case PUIT -> other == ROCK || other == SCISSORS;
}; };
} }
} }

View File

@@ -14,7 +14,7 @@ class MoveTest {
@Test @Test
void should_check_move_size(){ void should_check_move_size(){
Assertions.assertEquals(3, Move.values().length); Assertions.assertEquals(4, Move.values().length);
} }
@ParameterizedTest(name = "{0} should beat {1}") @ParameterizedTest(name = "{0} should beat {1}")
@@ -33,7 +33,10 @@ class MoveTest {
return Stream.of( return Stream.of(
Arguments.of(Move.ROCK,Move.SCISSORS), Arguments.of(Move.ROCK,Move.SCISSORS),
Arguments.of(Move.PAPER,Move.ROCK), Arguments.of(Move.PAPER,Move.ROCK),
Arguments.of(Move.SCISSORS,Move.PAPER) Arguments.of(Move.SCISSORS,Move.PAPER),
Arguments.of(Move.PAPER,Move.PUIT),
Arguments.of(Move.PUIT,Move.ROCK),
Arguments.of(Move.PUIT,Move.SCISSORS)
); );
} }
} }

View File

@@ -20,9 +20,10 @@ class RandomCpuPickerTest {
obtainedMoves.add(picker.pick()); obtainedMoves.add(picker.pick());
} }
assertEquals(3, obtainedMoves.size()); assertEquals(4, obtainedMoves.size());
assertTrue(obtainedMoves.contains(Move.ROCK)); assertTrue(obtainedMoves.contains(Move.ROCK));
assertTrue(obtainedMoves.contains(Move.PAPER)); assertTrue(obtainedMoves.contains(Move.PAPER));
assertTrue(obtainedMoves.contains(Move.SCISSORS)); assertTrue(obtainedMoves.contains(Move.SCISSORS));
assertTrue(obtainedMoves.contains(Move.PUIT));
} }
} }