Line 38... |
Line 38... |
38 |
}
|
38 |
}
|
Line 39... |
Line 39... |
39 |
|
39 |
|
40 |
@Test
|
40 |
@Test
|
Line -... |
Line 41... |
- |
|
41 |
public void testCalculerVoteDeterminationPlusPopulaire() {
|
- |
|
42 |
|
- |
|
43 |
Contributeur cIdent1 = new Contributeur("1", "Peronnet", "Aurélien", "aurelien@tela-botanica.org");
|
- |
|
44 |
Contributeur cIdent2 = new Contributeur("2", "Liens", "Benjamin", "benjamin@tela-botanica.org");
|
- |
|
45 |
|
41 |
public void testCalculerVoteDeterminationPlusPopulaire() {
|
46 |
Contributeur cAnon1 = new Contributeur("a1a5f7b8s8c4v2b3g4g5t7t8t94", "", "", "");
|
42 |
|
47 |
|
43 |
VoteDetermination voteDetermination1 = new VoteDetermination();
|
48 |
VoteDetermination voteDetermination1 = new VoteDetermination();
|
44 |
voteDetermination1.setVote(1);
|
49 |
voteDetermination1.setVote(1);
|
- |
|
50 |
voteDetermination1.setDate(new Date());
|
Line 45... |
Line 51... |
45 |
voteDetermination1.setDate(new Date());
|
51 |
voteDetermination1.setContributeur(cIdent1.getId());
|
46 |
voteDetermination1.setContributeur("benjamin");
|
52 |
voteDetermination1.setAuteur(cIdent1);
|
47 |
|
53 |
|
48 |
VoteDetermination voteDetermination2 = new VoteDetermination();
|
54 |
VoteDetermination voteDetermination2 = new VoteDetermination();
|
- |
|
55 |
voteDetermination2.setVote(1);
|
Line 49... |
Line 56... |
49 |
voteDetermination2.setVote(1);
|
56 |
voteDetermination2.setDate(new Date());
|
50 |
voteDetermination2.setDate(new Date());
|
57 |
voteDetermination2.setContributeur(cIdent2.getId());
|
51 |
voteDetermination2.setContributeur("aurelien");
|
58 |
voteDetermination2.setAuteur(cIdent2);
|
52 |
|
59 |
|
53 |
VoteDetermination voteDetermination3 = new VoteDetermination();
|
- |
|
54 |
voteDetermination3.setVote(0);
|
- |
|
55 |
voteDetermination3.setDate(new Date());
|
- |
|
56 |
voteDetermination3.setContributeur("benjamin");
|
- |
|
57 |
|
- |
|
58 |
VoteDetermination voteDetermination4 = new VoteDetermination();
|
- |
|
59 |
voteDetermination3.setVote(0);
|
- |
|
60 |
voteDetermination3.setDate(new Date());
|
60 |
VoteDetermination voteDetermination3 = new VoteDetermination();
|
61 |
voteDetermination3.setContributeur("benjamin");
|
- |
|
62 |
|
- |
|
Line 63... |
Line 61... |
63 |
VoteDetermination voteDetermination5 = new VoteDetermination();
|
61 |
voteDetermination3.setVote(0);
|
64 |
voteDetermination4.setVote(1);
|
62 |
voteDetermination3.setDate(new Date());
|
65 |
voteDetermination4.setDate(new Date());
|
63 |
voteDetermination3.setContributeur(cAnon1.getId());
|
66 |
voteDetermination4.setContributeur("benjamin");
|
64 |
voteDetermination3.setAuteur(cAnon1);
|
67 |
|
- |
|
68 |
PropositionDetermination propositionDetermination = new PropositionDetermination(new Observation());
|
65 |
|
69 |
propositionDetermination.setEspece("Iris lutescens subsp. lutescens");
|
66 |
PropositionDetermination propositionDetermination = new PropositionDetermination(new Observation());
|
70 |
propositionDetermination.setContributeur(new Contributeur("1", "contrib", "test", "contrib@test.com"));
|
- |
|
Line 71... |
Line 67... |
71 |
propositionDetermination.setId("1");
|
67 |
propositionDetermination.setEspece("Iris lutescens subsp. lutescens");
|
72 |
propositionDetermination.ajouterVoteDetermination(voteDetermination1);
|
68 |
propositionDetermination.setContributeur(new Contributeur("1", "contrib", "test", "contrib@test.com"));
|
73 |
propositionDetermination.ajouterVoteDetermination(voteDetermination2);
|
69 |
propositionDetermination.setId("1");
|
74 |
propositionDetermination.ajouterVoteDetermination(voteDetermination3);
|
70 |
propositionDetermination.ajouterVoteDetermination(voteDetermination2);
|
75 |
propositionDetermination.ajouterVoteDetermination(voteDetermination4);
|
71 |
propositionDetermination.ajouterVoteDetermination(voteDetermination3);
|
76 |
|
72 |
|
77 |
PropositionDetermination propositionDetermination2 = new PropositionDetermination(new Observation());
|
73 |
PropositionDetermination propositionDetermination2 = new PropositionDetermination(new Observation());
|
78 |
propositionDetermination2.setEspece("Iris urticans");
|
- |
|
Line 79... |
Line 74... |
79 |
propositionDetermination2.setContributeur(new Contributeur("1", "contrib", "test", "contrib@test.com"));
|
74 |
propositionDetermination2.setEspece("Iris urticans");
|
80 |
propositionDetermination2.setId("2");
|
75 |
propositionDetermination2.setContributeur(new Contributeur("1", "contrib", "test", "contrib@test.com"));
|
81 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination1);
|
76 |
propositionDetermination2.setId("2");
|
Line 82... |
Line 77... |
82 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination2);
|
77 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination1);
|
83 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination3);
|
78 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination2);
|
Line 84... |
Line 79... |
84 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination5);
|
79 |
propositionDetermination2.ajouterVoteDetermination(voteDetermination3);
|
85 |
|
80 |
|
86 |
List<PropositionDetermination> listePropositions = new ArrayList<PropositionDetermination>();
|
81 |
List<PropositionDetermination> listePropositions = new ArrayList<PropositionDetermination>();
|
Line 87... |
Line 82... |
87 |
listePropositions.add(propositionDetermination2);
|
82 |
listePropositions.add(propositionDetermination2);
|