use of org.apache.pivot.util.VoteResult in project pivot by apache.
the class VoteResultTest method test1.
@Test
public void test1() {
ArrayList<Vote> votes = new ArrayList<>();
votes.add(Vote.APPROVE);
votes.add(Vote.DEFER);
votes.add(Vote.DENY);
// These are the expected results as each vote is tallied
ArrayList<Vote> results = new ArrayList<>();
results.add(Vote.APPROVE);
results.add(Vote.DEFER);
results.add(Vote.DENY);
VoteResult result = new VoteResult();
Iterator<Vote> resultIter = results.iterator();
for (Vote vote : votes) {
result.tally(vote);
assertEquals(result.get(), resultIter.next());
}
}
Aggregations