Subversion Repositories eFlore/Applications.del

Rev

Rev 882 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 882 Rev 959
Line 1... Line 1...
1
package org.tela_botanica.del.test.composants.votes;
1
package org.tela_botanica.del.test.composants.votes;
Line 2... Line 2...
2
 
2
 
3
import static org.junit.Assert.*;
3
import static org.junit.Assert.assertEquals;
Line 4... Line 4...
4
import static org.mockito.Mockito.mock;
4
import static org.mockito.Mockito.mock;
Line 5... Line 5...
5
 
5
 
6
import java.util.Date;
6
import java.util.Date;
7
 
-
 
8
import org.junit.Before;
7
 
9
import org.junit.Test;
8
import org.junit.Before;
10
import org.mockito.Mock;
9
import org.junit.Test;
11
import org.mockito.Mockito;
10
import org.mockito.Mockito;
12
import org.tela_botanica.del.client.composants.votes.barrerepartition.BarreRepartitionVotePresenteur;
11
import org.tela_botanica.del.client.composants.votes.barrerepartition.BarreRepartitionVotePresenteur;
13
import org.tela_botanica.del.client.composants.votes.barrerepartition.BarreRepartitionVotePresenteur.Vue;
12
import org.tela_botanica.del.client.composants.votes.barrerepartition.BarreRepartitionVotePresenteur.Vue;
14
import org.tela_botanica.del.client.modeles.Contributeur;
13
import org.tela_botanica.del.client.modeles.Contributeur;
15
import org.tela_botanica.del.client.modeles.MoyenneVote;
14
import org.tela_botanica.del.client.modeles.MoyenneVote;
16
import org.tela_botanica.del.client.modeles.Observation;
15
import org.tela_botanica.del.client.modeles.Observation;
17
import org.tela_botanica.del.client.modeles.PropositionDetermination;
-
 
18
import org.tela_botanica.del.client.modeles.VoteDetermination;
-
 
19
import org.tela_botanica.del.client.services.CalculVoteDeterminationService;
-
 
20
 
-
 
21
import com.google.gwt.event.dom.client.ClickHandler;
16
import org.tela_botanica.del.client.modeles.PropositionDetermination;
22
import com.google.gwt.event.dom.client.HasClickHandlers;
-
 
23
import com.google.gwt.event.shared.GwtEvent;
-
 
Line 24... Line 17...
24
import com.google.gwt.event.shared.HandlerRegistration;
17
import org.tela_botanica.del.client.modeles.VoteDetermination;
Line 25... Line 18...
25
import com.google.gwt.user.client.ui.IsWidget;
18
import org.tela_botanica.del.client.services.CalculVoteDeterminationService;
26
import com.google.gwt.user.client.ui.Widget;
19
import org.tela_botanica.del.client.services.rest.VoteDeterminationService;
Line 27... Line 20...
27
 
20
 
28
public class BarreRepartitionVotePresenteurTest {
21
public class BarreRepartitionVotePresenteurTest {
Line 29... Line 22...
29
 
22
 
-
 
23
	private BarreRepartitionVotePresenteur barreRepartitionVotePresenteur;
30
	private BarreRepartitionVotePresenteur barreRepartitionVotePresenteur;
24
	private BarreRepartitionVotePresenteur.Vue vue;
Line 31... Line 25...
31
	private BarreRepartitionVotePresenteur.Vue vue;
25
 
32
	
26
	@Before
33
	@Before
27
	public void setUp() {
34
	public void setUp() {
28
 
Line 54... Line 48...
54
	@Test
48
	@Test
55
	public void testVoter() {
49
	public void testVoter() {
56
		assertEquals("Iris lutescens subsp. lutescens", barreRepartitionVotePresenteur.getMoyenneVote().getIntituleAssocie());
50
		assertEquals("Iris lutescens subsp. lutescens", barreRepartitionVotePresenteur.getMoyenneVote().getIntituleAssocie());
57
		assertEquals(100, barreRepartitionVotePresenteur.getMoyenneVote().getScore());
51
		assertEquals(100, barreRepartitionVotePresenteur.getMoyenneVote().getScore());
58
		barreRepartitionVotePresenteur.voter(false);
52
		barreRepartitionVotePresenteur.voter(false);
59
		assertEquals(50, barreRepartitionVotePresenteur.getMoyenneVote().getScore());
53
		assertEquals(100, barreRepartitionVotePresenteur.getMoyenneVote().getScore());
60
	}
54
	}
Line 61... Line 55...
61
 
55