inesV2 #10

Open
ines.benalia wants to merge 3 commits from inesV2 into master
Showing only changes of commit 8fa260fd23 - Show all commits

View File

@ -85,20 +85,28 @@ public class CommandeTest {
}
/**
* Test of supprimer method, of class Commande.
@Test
public void testSupprimer() {
System.out.println("supprimer");
Instrument unInstrument = null;
Commande instance = null;
boolean expResult = false;
boolean result = instance.supprimer(unInstrument);
assertEquals("test supprimer",expResult, result);
// TODO review the generated test code and remove the default call to fail.
fail("The test case is a prototype.");
}*/
//instanciation
Instrument instr1=new Instrument(1,"Piano",10, 8300f);
Instrument instr2=new Instrument(2,"Violon",9, 105f);
Commande laCommande = new Commande(1,1,"12/09/2024");
laCommande.ajouter(instr1, 2);
boolean expectedResult=false;
boolean expectedResult2=true;
// test
boolean test= laCommande.supprimer(instr2);
boolean test2= laCommande.supprimer(instr1);
assertEquals("suppression impossible",expectedResult,test);
assertEquals("suppression possible ",test2,expectedResult2 );
System.out.println("Nombre de ligne dans le dictionnaire: "+laCommande.getLesLignes().size());
}
}