Created by sophie on 01.02.17.
More...
Inherits TestCase.
Definition at line 42 of file CMinisumApprovalTest.java.
org.lightvoting.simulation.rule.CMinisumApprovalTest.CMinisumApprovalTest |
( |
final String |
p_testName | ) |
|
static Test org.lightvoting.simulation.rule.CMinisumApprovalTest.suite |
( |
| ) |
|
|
static |
- Returns
- the suite of tests being tested
Definition at line 62 of file CMinisumApprovalTest.java.
CMinisumApprovalTest(final String p_testName)
Create the test case.
void org.lightvoting.simulation.rule.CMinisumApprovalTest.testCMinisumApproval |
( |
| ) |
|
Definition at line 71 of file CMinisumApprovalTest.java.
74 final CMinisumApproval l_tester =
new CMinisumApproval();
76 final List<String> l_testAlternatives =
new ArrayList<>();
77 l_testAlternatives.add(
"POI1" );
78 l_testAlternatives.add(
"POI2" );
79 l_testAlternatives.add(
"POI3" );
81 final List<BitVector> l_testVotes =
new ArrayList<>();
83 final BitVector l_vote1 =
new BitVector( 3 );
84 l_vote1.put( 0, true );
86 final BitVector l_vote2 =
new BitVector( 3 );
88 l_vote2.put( 1, true );
89 l_vote2.put( 2, true );
91 final BitVector l_vote3 =
new BitVector( 3 );
93 l_vote3.put( 1, true );
94 l_vote3.put( 2, true );
96 l_testVotes.add( l_vote1 );
97 l_testVotes.add( l_vote2 );
98 l_testVotes.add( l_vote3 );
100 final int l_testComSize = 2;
101 final BitVector l_result = l_tester.applyRuleBV( l_testAlternatives, l_testVotes, l_testComSize );
103 assertFalse( l_result.get( 0 ) );
104 assertTrue( l_result.get( 1 ) );
105 assertTrue( l_result.get( 2 ) );
void org.lightvoting.simulation.rule.CMinisumApprovalTest.testCMinisumApproval1 |
( |
| ) |
|
Definition at line 112 of file CMinisumApprovalTest.java.
115 final CMinisumApproval l_tester =
new CMinisumApproval();
117 final List<String> l_testAlternatives =
new ArrayList<>();
118 l_testAlternatives.add(
"POI1" );
119 l_testAlternatives.add(
"POI2" );
120 l_testAlternatives.add(
"POI3" );
122 final List<BitVector> l_testVotes =
new ArrayList<>();
123 final BitVector l_vote1 =
new BitVector( 3 );
124 l_vote1.put( 0, true );
125 l_vote1.put( 2, true );
127 final BitVector l_vote2 =
new BitVector( 3 );
128 l_vote2.put( 1, true );
130 final BitVector l_vote3 =
new BitVector( 3 );
132 l_vote3.put( 0, true );
133 l_vote3.put( 1, true );
134 l_vote3.put( 2, true );
136 l_testVotes.add( l_vote1 );
137 l_testVotes.add( l_vote2 );
138 l_testVotes.add( l_vote3 );
140 final int l_testComSize = 2;
141 final BitVector l_result = l_tester.applyRuleBV( l_testAlternatives, l_testVotes, l_testComSize );
142 assertTrue( l_result.get( 0 ) );
143 assertTrue( l_result.get( 1 ) );
144 assertFalse( l_result.get( 2 ) );
void org.lightvoting.simulation.rule.CMinisumApprovalTest.testCMinisumApproval3 |
( |
| ) |
|
Definition at line 151 of file CMinisumApprovalTest.java.
154 final CMinisumApproval l_tester =
new CMinisumApproval();
156 List<String> l_testAlternatives;
157 l_testAlternatives =
new ArrayList<String>();
158 l_testAlternatives.add(
"POI1" );
159 l_testAlternatives.add(
"POI2" );
160 l_testAlternatives.add(
"POI3" );
161 l_testAlternatives.add(
"POI4" );
162 l_testAlternatives.add(
"POI5" );
163 l_testAlternatives.add(
"POI6" );
165 final List<BitVector> l_testVotes =
new ArrayList<>( );
166 final BitVector l_vote1 =
new BitVector( 6 );
168 l_vote1.put( 0, true );
169 l_vote1.put( 2, true );
170 l_vote1.put( 3, true );
171 l_vote1.put( 5, true );
173 final BitVector l_vote2 =
new BitVector( 6 );
175 l_vote2.put( 0, true );
176 l_vote2.put( 2, true );
177 l_vote2.put( 3, true );
178 l_vote2.put( 5, true );
180 final BitVector l_vote3 =
new BitVector( 6 );
182 l_vote3.put( 0, true );
183 l_vote3.put( 2, true );
184 l_vote3.put( 3, true );
185 l_vote3.put( 5, true );
187 final BitVector l_vote4 =
new BitVector( 6 );
189 l_vote4.put( 2, true );
191 l_testVotes.add( l_vote1 );
192 l_testVotes.add( l_vote2 );
193 l_testVotes.add( l_vote3 );
194 l_testVotes.add( l_vote4 );
196 final int l_testComSize = 3;
197 final BitVector l_result = l_tester.applyRuleBV( l_testAlternatives, l_testVotes, l_testComSize );
198 assertTrue( l_result.get( 0 ) );
199 assertFalse( l_result.get( 1 ) );
200 assertTrue( l_result.get( 2 ) );
201 assertTrue( l_result.get( 3 ) );
202 assertFalse( l_result.get( 4 ) );
203 assertFalse( l_result.get( 5 ) );