-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileDAttenteTestVersionProf.java
More file actions
55 lines (46 loc) · 1.42 KB
/
FileDAttenteTestVersionProf.java
File metadata and controls
55 lines (46 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
*
*/
package tpSalleDAttente;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* @author jean_hubert
*
*/
class FileDAttenteTestVersionProf {
private SalleDAttentePAPS<ClientAvecPrio> sallePAPS;
private SalleDAttenteAvecPrio<ClientAvecPrio> sallePrio;
/**
* @throws java.lang.Exception
*/
@BeforeEach
void setUp() throws Exception {
sallePAPS = new SalleDAttentePAPS<ClientAvecPrio> (5);
sallePrio = new SalleDAttenteAvecPrio<ClientAvecPrio>(5,3);
}
@Test
void testUnElement() {
ClientAvecPrio c = new ClientAvecPrio("un client",1);
testUnElement(sallePAPS, c);
}
@Test
void testUnElement2() {
ClientAvecPrio c = new ClientAvecPrio("un client",1);
testUnElement(sallePrio, c);
}
private void testUnElement(SalleDAttente s, ClientAvecPrio c) {
assertTrue("La salle doit être vide", s.estVide()) ;
s.entrer(c); ;
assertTrue("La salle ne doit pas être vide", ! s.estVide()) ;
assertTrue("La salle ne doit pas être pleine", ! s.estPleine()) ;
assertEquals(1, s.getNbClients(), "La salle doit être de taille 1") ;
assertSame(c, s.getProchain(), "Le prochain à sortir doit être le premier entré") ;
s.sortir();
assertTrue("La salle doit être vide", s.estVide()) ;
}
}