test: test numeric score

pull/14/head^2
Dominique Merle 3 years ago
parent a7aa8a82b5
commit 85e0c3e419

@ -367,6 +367,26 @@ class MajorityJudgmentDeliberatorTest {
assertEquals(1, result.getProposalResults()[2].getAnalysis().getMedianGrade());
}
@Test
@DisplayName("Test numeric score")
public void testNumericScore() throws Exception {
boolean favorContestation = true;
boolean numerizeScore = true;
Integer amountOfJudges = 3;
DeliberatorInterface mj = new MajorityJudgmentDeliberator(favorContestation, numerizeScore);
TallyInterface tally = new Tally(new ProposalTallyInterface[] {
new ProposalTally(new Integer[]{ 1, 0, 2 }),
new ProposalTally(new Integer[]{ 0, 2, 1 }),
}, amountOfJudges);
ResultInterface result = mj.deliberate(tally);
assertNotNull(result);
assertEquals("202003003", result.getProposalResults()[0].getScore());
assertEquals("104203003", result.getProposalResults()[1].getScore());
}
@Test
@DisplayName("Fail on unbalanced tallies")
public void testFailureOnUnbalancedTallies() {

Loading…
Cancel
Save