Compare commits
1 Commits
steve-3
...
developpem
Author | SHA1 | Date | |
---|---|---|---|
13016d5e9f |
4
readme.yaml
Normal file
4
readme.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- Projet Gestion d'un bibliothèque
|
||||||
|
support pour découvrir les tests : unitaire, d'intégration, fonctionnels
|
||||||
|
Java, JUNIT
|
||||||
|
promo 2026 - D5 - A01 à A04
|
@@ -110,7 +110,7 @@ public class LivreValide {
|
|||||||
i++;
|
i++;
|
||||||
System.out.println(i+". "+unLivre.getTitre());
|
System.out.println(i+". "+unLivre.getTitre());
|
||||||
}
|
}
|
||||||
System.out.print("Merci de faire le choix du livre à restituer: ");
|
System.out.print("Merci de faire votre choix : ");
|
||||||
int choix = sc.nextInt();
|
int choix = sc.nextInt();
|
||||||
Livre leLivre = user.getEmprunts().get(choix-1);
|
Livre leLivre = user.getEmprunts().get(choix-1);
|
||||||
|
|
||||||
|
@@ -10,7 +10,6 @@ package com.mycompany.bibliotheque;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
import com.mycompany.bibliotheque.Controle.LivreValide;
|
|
||||||
import com.mycompany.bibliotheque.Metier.Bibliotheque;
|
import com.mycompany.bibliotheque.Metier.Bibliotheque;
|
||||||
import com.mycompany.bibliotheque.Metier.Emprunt;
|
import com.mycompany.bibliotheque.Metier.Emprunt;
|
||||||
import com.mycompany.bibliotheque.Metier.Utilisateur;
|
import com.mycompany.bibliotheque.Metier.Utilisateur;
|
||||||
@@ -25,16 +24,14 @@ public class GestionBibliotheque {
|
|||||||
Bibliotheque laBibli = new Bibliotheque();
|
Bibliotheque laBibli = new Bibliotheque();
|
||||||
ArrayList<Livre> mesLivres = new ArrayList<>();
|
ArrayList<Livre> mesLivres = new ArrayList<>();
|
||||||
Livre l1 = new Livre("Le secret des secrets","Dan Brown","9782709668385",true);
|
Livre l1 = new Livre("Le secret des secrets","Dan Brown","9782709668385",true);
|
||||||
mesLivres.add(l1);
|
//Utilisateur u1 = new Utilisateur("Alice", mesLivres.add(l1));
|
||||||
Utilisateur u1 = new Utilisateur("Alice", mesLivres);
|
|
||||||
|
|
||||||
System.out.println("Bienvenue dans la bibliothèque !");
|
System.out.println("Bienvenue dans la bibliothèque !");
|
||||||
while (choix!=4){
|
while (choix!=4){
|
||||||
System.out.println("1. Afficher un livre");
|
System.out.println("1. Afficher un livre");
|
||||||
System.out.println("2. Ajouter un livre");
|
System.out.println("2. Ajouter un livre");
|
||||||
System.out.println("3. Afficher les livres");
|
System.out.println("3. Afficher les livres");
|
||||||
System.out.println("4. Restituer un livre");
|
System.out.println("4. Quitter");
|
||||||
System.out.println("5. Quitter");
|
|
||||||
System.out.print("Merci de faire votre choix : ");
|
System.out.print("Merci de faire votre choix : ");
|
||||||
choix = sc.nextInt();
|
choix = sc.nextInt();
|
||||||
switch (choix) {
|
switch (choix) {
|
||||||
@@ -49,21 +46,6 @@ public class GestionBibliotheque {
|
|||||||
System.out.println("---"+leLivre.toString());
|
System.out.println("---"+leLivre.toString());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
|
||||||
boolean restitution = LivreValide.retourLivre(u1);
|
|
||||||
String message = "";
|
|
||||||
|
|
||||||
if (restitution) {
|
|
||||||
message += "Le livre a été restitué !\n";
|
|
||||||
message += "\\nVous avez désormais "+u1.getEmprunts().size()+" livres empruntés sur 3 !\n";
|
|
||||||
message += "Merci, "+u1.getNom()+", d'avoir emprunté chez nous !";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
message += "Le livre n'a pas été restitué.";
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println(message);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user