273 |
aurelien |
1 |
package org.tela_botanica.del.test.modeles;
|
|
|
2 |
|
|
|
3 |
import static org.junit.Assert.*;
|
|
|
4 |
|
|
|
5 |
import java.util.ArrayList;
|
|
|
6 |
import java.util.Date;
|
|
|
7 |
import java.util.HashMap;
|
|
|
8 |
|
|
|
9 |
import org.junit.Test;
|
|
|
10 |
import org.tela_botanica.del.client.modeles.MoyenneVote;
|
|
|
11 |
import org.tela_botanica.del.client.modeles.PropositionDetermination;
|
|
|
12 |
|
|
|
13 |
public class MoyenneVoteTest {
|
|
|
14 |
|
|
|
15 |
@Test
|
|
|
16 |
public void testCompareTo() {
|
|
|
17 |
|
|
|
18 |
PropositionDetermination propositionDetermination = new PropositionDetermination();
|
|
|
19 |
MoyenneVote mv1 = new MoyenneVote(100, propositionDetermination);
|
|
|
20 |
|
|
|
21 |
PropositionDetermination propositionDetermination2 = new PropositionDetermination();
|
|
|
22 |
MoyenneVote mv2 = new MoyenneVote(75, propositionDetermination2);
|
|
|
23 |
|
|
|
24 |
PropositionDetermination propositionDetermination3 = new PropositionDetermination();
|
|
|
25 |
MoyenneVote mv3 = new MoyenneVote(50, propositionDetermination3);
|
|
|
26 |
|
|
|
27 |
PropositionDetermination propositionDetermination4 = new PropositionDetermination();
|
|
|
28 |
MoyenneVote mv4 = new MoyenneVote(50, propositionDetermination4);
|
|
|
29 |
|
|
|
30 |
int mv1SuperieurMv2 = mv1.compareTo(mv2);
|
|
|
31 |
assertEquals(-1, mv1SuperieurMv2);
|
|
|
32 |
|
|
|
33 |
int mv3InferieurMv2 = mv3.compareTo(mv2);
|
|
|
34 |
assertEquals(1, mv3InferieurMv2);
|
|
|
35 |
|
|
|
36 |
int mv4EgalMv3 = mv4.compareTo(mv3);
|
|
|
37 |
assertEquals(0, mv4EgalMv3);
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
}
|