diff --git a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java index 372b6b5..7105505 100644 --- a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java +++ b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java @@ -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() {