From 9210f0c93d857dcac6df38487e29ec96b2c21973 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Fri, 30 Nov 2018 17:38:01 +0100 Subject: [PATCH] [POO Note] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ajout méthode achatDeMatériel - Ajout du test unitaire pour achatDeMatériel --- ENSIM/Java/POOtpnote/.idea/workspace.xml | 68 +++++++----------- .../src/main/java/entity/Administrateur.java | 10 +++ .../src/test/java/AdministrateurTest.java | 9 +++ .../classes/entity/Administrateur.class | Bin 3071 -> 3169 bytes .../test-classes/AdministrateurTest.class | Bin 5795 -> 6032 bytes 5 files changed, 46 insertions(+), 41 deletions(-) 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 a31c9e2b2c2196c8cac25174b55799b41786ef28..8ef6e1a059750e7a45b721cec3d2497c525893fb 100644 GIT binary patch delta 465 zcmYL_O-~b16o#Maj9xn2Dv^Yb6%Z>z%ZF~*k`UAdAL2&^EvN&GP%Q&Yr_~}*Py}_$ zPjJ;Gfv|AFraS)yKY)cBHzevkxG*<4Iq&;EIp^g5X+CYK{P_L-1h~ytmsZAH+89^d zS4_Bc@F31Z9@X*KCBu`raVA|Hrd*!#Op56o=^V0>PP^D-CCJt@!*iMOLOjFSycEx? zXO=lB^9nyHTQ7#Z5_Um|MJYMOYdPkPB7g8LV>ev&<`%tZ*dOyEKg{|0{a<#CqG^Dc)+{QPPwd&~%ehtZCk}uIZ&u zvmy2-6~&fjn?Un{j}}+_Aj(DM{yR%6`Q@^&*%9t8_mY}V>}vM-Y;o;B6&8cYo6Q^Y z3&G(}=iIUqhi8`)mokG`B+b7M5i<|m)DiLYF^S0oqhj0;?;_bEZcgYly6GRuO}dPd Pyq{ZUj>U*kF-HFaDWzBO delta 368 zcmYL@J2L}e7=@p;8=q`G3JO%1NrAYGf`5R5xW^@~!6NJ?vDt*U#r;y}C#X`IbP7#6 z|HAJuBlgp1&YU^tne)D1ZMD|o=g<2GFvN>VJCi0ILvY>mGY8aVQ|#R*y(~Lxl`O2 o<6+4?50XcoG@Ab@H<$7f+qO?W<5cv(x2DNTt-di3fI23A0r_7^g#Z8m diff --git a/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class b/ENSIM/Java/POOtpnote/target/test-classes/AdministrateurTest.class index 2d03ca6477e9607990bb8c1851eda48c99cc1f6f..221df2ca0f333d29e7f0fe321cee83791e85872a 100644 GIT binary patch delta 1952 zcmah~`*Ra@5dU10=C0Ro)Aa4wmKGcbi&HaHMlJ2sskJ~UsTM3nq>r>cN+3<}npCS| zz^W)J0;i$^tqQ&^uVNKc1YcErR(!wkjgI4te}UuffA8TaXtRSW$1#8pLfORr%Q81*!758sda2v;O=Zy8~xC3{}*r39V zyEuHejC)jMVGTPQW!$SGH|}hbu~|hy+}Xmn4L0}1WZbW!2oJEgRmOuVO5)B#9C?_{ zHa6Q?!w$YX%xy=Q^oW8-RXm2B?CetTIO7v6ZCJsROc>_KQwpADd`7{u3Z7Fi%HD1T zdsNJ+!CnRXxa9tHjNt&A=Vgp5ctORBIH;lqhq%d0OnOrU$g3vCdiMXhXX(>YSyt;Z1=?EHHj|PK)`_B*9(V ztA)C?(w=B(Q&{g2xB^WAZ(%~l+XC<4n1u8`vy?yRZK)Gz!@B}kqM4|Pczw6-4+$*f zXl5e1C>+%T{Q`?P>`8>{g8qSkri&P^LbE^%o5h@xr-dSc$e_2jr!No+^hb1R8`Zhv zdjhRkLLIG)`o7h{@SrAeHI@i0WpfRiWo+KZgun-EKEy`?0Zd9L@JAwgpew5BK5Hzq zOS6{y13?)d3mnHM0)3b?&UO_!LYOcrU4@P?VXJGJ>r;Ft;ZozMtJv7?8gYD1ldO^F zI=(Qm%qUihvIV}xS2Dg9_y*q!e1{Xp33=$O?*)Fqj{-k&@Hl=J_yz3}YK&UB&?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