Created by sophie on 09.02.17.
More...
Inherits TestCase.
Definition at line 38 of file CMinimaxApprovalTest.java.
org.lightvoting.simulation.rule.CMinimaxApprovalTest.CMinimaxApprovalTest |
( |
final String |
p_testName | ) |
|
static Test org.lightvoting.simulation.rule.CMinimaxApprovalTest.suite |
( |
| ) |
|
|
static |
- Returns
- the suite of tests being tested
Definition at line 56 of file CMinimaxApprovalTest.java.
CMinimaxApprovalTest(final String p_testName)
Create the test case.
void org.lightvoting.simulation.rule.CMinimaxApprovalTest.testApplyRule |
( |
| ) |
|
Definition at line 64 of file CMinimaxApprovalTest.java.
66 final CMinimaxApproval l_minimaxApproval =
new CMinimaxApproval();
68 final List<String> l_alternatives =
new ArrayList<String>();
70 l_alternatives.add(
"POI1" );
71 l_alternatives.add(
"POI2" );
72 l_alternatives.add(
"POI3" );
73 l_alternatives.add(
"POI4" );
74 l_alternatives.add(
"POI5" );
75 l_alternatives.add(
"POI6" );
77 final List<BitVector> l_votes =
new ArrayList<>();
79 final BitVector l_vote1 =
new BitVector( 6 );
80 l_vote1.put( 0, true );
81 l_vote1.put( 1, true );
82 l_vote1.put( 2, true );
83 l_vote1.put( 3, true );
84 l_vote1.put( 4, true );
86 final BitVector l_vote2 = l_vote1.copy();
87 final BitVector l_vote3 = l_vote1.copy();
88 final BitVector l_vote4 = l_vote1.copy();
89 final BitVector l_vote5 = l_vote1.copy();
91 final BitVector l_vote6 =
new BitVector( 6 );
92 l_vote6.put( 3, true );
93 l_vote6.put( 4, true );
94 l_vote6.put( 5, true );
96 l_votes.add( l_vote1 );
97 l_votes.add( l_vote2 );
98 l_votes.add( l_vote3 );
99 l_votes.add( l_vote4 );
100 l_votes.add( l_vote5 );
101 l_votes.add( l_vote6 );
103 final int l_comSize = 3;
105 final BitVector l_bitVector = l_minimaxApproval.applyRuleBV( l_alternatives, l_votes, l_comSize );
106 System.out.println( l_bitVector );