From 06800433842eb759ce2290c9bd304a9538702c76 Mon Sep 17 00:00:00 2001 From: sio Date: Thu, 12 Sep 2024 11:33:20 +0200 Subject: [PATCH] test cas1 --- test/métiers/CommandeTest.java | 59 ++++------------------------------ 1 file changed, 7 insertions(+), 52 deletions(-) diff --git a/test/métiers/CommandeTest.java b/test/métiers/CommandeTest.java index ed03a45..e4d515e 100644 --- a/test/métiers/CommandeTest.java +++ b/test/métiers/CommandeTest.java @@ -5,12 +5,9 @@ package métiers; import java.util.HashMap; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; -import org.junit.jupiter.api.BeforeAll; /** * @@ -20,44 +17,25 @@ public class CommandeTest { public CommandeTest() { } - - @BeforeAll - public static void setUpClass() throws Exception { - } - - @AfterAll - public static void tearDownClass() throws Exception { - } @BeforeEach public void setUp() { } - @AfterEach - public void tearDown() throws Exception { - } - /** * Test of ajouter method, of class Commande. */ @Test public void testAjouter() { System.out.println("ajouter"); + Instrument unInstrument = null; + int qte = 0; Commande instance = null; - Instrument instr1=new Instrument(1,"Piano",10, 8300f); - Instrument instr2=new Instrument(2,"Violon",9, 105f); - Instrument instr3=new Instrument(3,"Guitare",8, 575f); - //Cas0 - instance.ajouter(instr1, 2); - // Cas1 - - instance.ajouter(instr2, 6); - - int nbLignesAttendues=2; - int nbLignes=instance.getLesLignes().size(); - assertEquals("Cas01 : test nb lignes ",nbLignesAttendues,nbLignes); - - + boolean expResult = false; + boolean result = instance.ajouter(unInstrument, qte); + assertEquals(expResult, result); + // TODO review the generated test code and remove the default call to fail. + fail("The test case is a prototype."); } /** @@ -184,28 +162,5 @@ public class CommandeTest { // TODO review the generated test code and remove the default call to fail. fail("The test case is a prototype."); } - - private void assertEquals(String test_nb_lignes, int nbLignesAttendues, int i) { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - private void assertEquals(boolean expResult, boolean result) { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - private void assertEquals(int expResult, int result) { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - private void assertEquals(String expResult, String result) { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - private void assertEquals(HashMap expResult, HashMap result) { - throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody - } - - - }