-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagasinTest.java
More file actions
45 lines (33 loc) · 973 Bytes
/
Copy pathMagasinTest.java
File metadata and controls
45 lines (33 loc) · 973 Bytes
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
import static org.junit.jupiter.api.Assertions.*;
import java.util.HashMap;
import java.util.Map;
import org.junit.jupiter.api.Test;
class MagasinTest {
@Test
public void testContenu() {
Magasin.ajouterArticle(new Article("Ski",200,400,"P"),5);
boolean bool = Magasin.contenu("Ski","P");
assertEquals(true,bool);
}
@Test
public void testTraduction() {
Article result = Magasin.traduction("Ski","P");
Article key = Magasin.obtenirUneClefAvecKey(Magasin.getArticles(), 5);
assertEquals(result,key);
}
@Test
public void testObtenirUneClefAvecKey() {
Map<String, Integer> dico = new HashMap<>();
dico.put("Decathlon", 5);
String result = Magasin.obtenirUneClefAvecKey(dico,5);
assertEquals(result,"Decathlon");
}
@Test
public void testAjouterArticle() {
boolean bo = false ;
if (Magasin.getArticles().containsValue(5)) {
bo = true;
assertEquals(bo,true);
}
}
}