Subversion Repositories eFlore/Applications.del

Rev

Rev 273 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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;
838 aurelien 11
import org.tela_botanica.del.client.modeles.Observation;
273 aurelien 12
import org.tela_botanica.del.client.modeles.PropositionDetermination;
13
 
14
public class MoyenneVoteTest {
15
 
16
	@Test
17
	public void testCompareTo() {
18
 
838 aurelien 19
		PropositionDetermination propositionDetermination = new PropositionDetermination(new Observation());
273 aurelien 20
		MoyenneVote mv1 = new MoyenneVote(100, propositionDetermination);
21
 
838 aurelien 22
		PropositionDetermination propositionDetermination2 = new PropositionDetermination(new Observation());
273 aurelien 23
		MoyenneVote mv2 = new MoyenneVote(75, propositionDetermination2);
24
 
838 aurelien 25
		PropositionDetermination propositionDetermination3 = new PropositionDetermination(new Observation());
273 aurelien 26
		MoyenneVote mv3 = new MoyenneVote(50, propositionDetermination3);
27
 
838 aurelien 28
		PropositionDetermination propositionDetermination4 = new PropositionDetermination(new Observation());
273 aurelien 29
		MoyenneVote mv4 = new MoyenneVote(50, propositionDetermination4);
30
 
31
		int mv1SuperieurMv2 = mv1.compareTo(mv2);
32
		assertEquals(-1, mv1SuperieurMv2);
33
 
34
		int mv3InferieurMv2 = mv3.compareTo(mv2);
35
		assertEquals(1, mv3InferieurMv2);
36
 
37
		int mv4EgalMv3 = mv4.compareTo(mv3);
38
		assertEquals(0, mv4EgalMv3);
39
	}
40
 
41
}