fr_b02 / petri / src / arcElement / ArcOuteringTest.java @ 5
Historique | Voir | Annoter | Télécharger (1,122 ko)
1 | 4 | a19coudr | package arcElement; |
---|---|---|---|
2 | |||
3 | import static org.junit.jupiter.api.Assertions.*; |
||
4 | |||
5 | import org.junit.jupiter.api.Test; |
||
6 | |||
7 | import element.Place; |
||
8 | import element.Place.UndefinedToken; |
||
9 | |||
10 | 5 | a19coudr | /**
|
11 | * @author amaurycoudray
|
||
12 | *
|
||
13 | */
|
||
14 | 4 | a19coudr | class ArcOuteringTest { |
15 | |||
16 | @Test
|
||
17 | void testArcOutering() throws UndefinedToken { |
||
18 | ArcOutering ao = new ArcOutering(new Place(3), 2); |
||
19 | assertEquals(ArcOutering.class, ao.getClass()); |
||
20 | } |
||
21 | |||
22 | @Test
|
||
23 | void testToString() throws UndefinedToken { |
||
24 | ArcOutering ao = new ArcOutering(new Place(3), 2); |
||
25 | Place p = new Place(3); |
||
26 | assertEquals("ArcOutering value:2, " + p.toString(), ao.toString());
|
||
27 | |||
28 | } |
||
29 | |||
30 | @Test
|
||
31 | void testDoTransition() throws UndefinedToken { |
||
32 | Place p = new Place(3); |
||
33 | ArcOutering ao = new ArcOutering(p, 2); |
||
34 | ao.doTransition(); |
||
35 | assertEquals(1, p.getToken());
|
||
36 | } |
||
37 | |||
38 | @Test
|
||
39 | void testIsActive() throws UndefinedToken { |
||
40 | ArcOutering ao = new ArcOutering(new Place(3), 2); |
||
41 | assertTrue(ao.isActive()); |
||
42 | } |
||
43 | |||
44 | @Test
|
||
45 | void testIsPullable() throws UndefinedToken { |
||
46 | ArcOutering ao = new ArcOutering(new Place(3), 2); |
||
47 | assertTrue(ao.isPullable()); |
||
48 | ArcOutering ao1 = new ArcOutering(new Place(3), 4); |
||
49 | assertFalse(ao1.isPullable()); |
||
50 | } |
||
51 | |||
52 | } |