-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSommeTest.java
47 lines (39 loc) · 966 Bytes
/
SommeTest.java
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
import org.junit.*;
import static org.junit.Assert.*;
/**
* SommeTest
*
* @author Xavier Crégut <Prenom.Nom@enseeiht.fr>
*/
public class SommeTest extends TraitementTestAbstrait {
private static final double EPSILON = 1e-8;
private SommeAbstrait somme;
@Override
protected SommeAbstrait nouveauTraitement() {
return new FabriqueTraitementConcrete().somme();
}
@Override
public void setUp() {
try {
super.setUp();
this.somme = nouveauTraitement();
} catch (Exception e) {
e.printStackTrace();
}
}
@Test
public void testerChainage() {
testerChainage(true, true);
}
@Test
public void testerSommeNominal() {
Position p1 = new Position(1, 2);
assertEquals(0, this.somme.somme(), 0.0);
this.somme.gererDebutLot("Lot1");
this.somme.traiter(p1, 11);
assertEquals(11, this.somme.somme(), EPSILON);
this.somme.traiter(p1, 7);
assertEquals(18, this.somme.somme(), EPSILON);
this.somme.gererFinLot("Lot1");
}
}