diff --git a/ENSIM/Java/POOtpnote/.idea/workspace.xml b/ENSIM/Java/POOtpnote/.idea/workspace.xml index 48b818e..4e3f6f3 100644 --- a/ENSIM/Java/POOtpnote/.idea/workspace.xml +++ b/ENSIM/Java/POOtpnote/.idea/workspace.xml @@ -2,25 +2,7 @@ - - - - - - - - - - - - - - - - - - - + @@ -40,13 +22,13 @@ - + - + @@ -67,8 +49,8 @@ - - + + @@ -127,8 +109,8 @@ - - + + @@ -137,6 +119,8 @@ + + @@ -298,7 +282,7 @@ - + @@ -359,15 +343,6 @@ - - - - - - - - - @@ -389,6 +364,15 @@ + + + + + + + + + @@ -408,7 +392,7 @@ - + @@ -416,7 +400,7 @@ - + @@ -617,8 +601,8 @@ - - + + @@ -627,8 +611,8 @@ - - + + @@ -637,6 +621,8 @@ + + diff --git a/ENSIM/Java/POOtpnote/src/main/java/entity/Administrateur.java b/ENSIM/Java/POOtpnote/src/main/java/entity/Administrateur.java index 14282f9..9a82ca5 100644 --- a/ENSIM/Java/POOtpnote/src/main/java/entity/Administrateur.java +++ b/ENSIM/Java/POOtpnote/src/main/java/entity/Administrateur.java @@ -117,4 +117,14 @@ public class Administrateur extends Employe { index++; } } + + /*public Agence getAgencePlusMaterielDefectueux() + { + + }*/ + + public void achatDeMateriel(Empruntable empruntable) + { + entreprise.ajouterAuStock(empruntable); + } } diff --git a/ENSIM/Java/POOtpnote/src/test/java/AdministrateurTest.java b/ENSIM/Java/POOtpnote/src/test/java/AdministrateurTest.java index c271a9b..511aeb9 100644 --- a/ENSIM/Java/POOtpnote/src/test/java/AdministrateurTest.java +++ b/ENSIM/Java/POOtpnote/src/test/java/AdministrateurTest.java @@ -166,4 +166,13 @@ public class AdministrateurTest { Assert.assertEquals("supprimerMaterielDefectueuxAgence_avecMaterielDefectueux: fail car il reste un Empruntable defectueux", false, e.isDefectueux()); } } + + @Test + public void achatMateriel() + { + int stockA1 = e.listeMateriel().size(); + ((Administrateur) admin).achatDeMateriel(e1); + + Assert.assertEquals("achatDeMateriel: fail", stockA1 + 1, e.listeMateriel().size()); + } } diff --git a/ENSIM/Java/POOtpnote/target/classes/entity/Administrateur.class b/ENSIM/Java/POOtpnote/target/classes/entity/Administrateur.class index a31c9e2..8ef6e1a 100644 Binary files a/ENSIM/Java/POOtpnote/target/classes/entity/Administrateur.class and b/ENSIM/Java/POOtpnote/target/classes/entity/Administrateur.class differ diff --git a/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class b/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class index 2d03ca6..221df2c 100644 Binary files a/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class and b/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class differ