4 require 'election_test_helper'
6 class TestRunoffVote < Test::Unit::TestCase
7 include ElectionTestHelper
10 vote_array = Array.new
11 142.times {vote_array << "ABCD".split("")}
12 26.times {vote_array << "BCDA".split("")}
13 15.times {vote_array << "CDBA".split("")}
14 17.times {vote_array << "DCBA".split("")}
16 test_winner( "A", InstantRunoffVote.new(vote_array).result )
20 vote_array = Array.new
21 42.times {vote_array << "ABCD".split("")}
22 26.times {vote_array << "BCDA".split("")}
23 15.times {vote_array << "CDBA".split("")}
24 17.times {vote_array << "DCBA".split("")}
26 test_winner( "D", InstantRunoffVote.new(vote_array).result )
30 vote_array = Array.new
31 42.times {vote_array << "ABCD".split("")}
32 26.times {vote_array << "ACBD".split("")}
33 15.times {vote_array << "BACD".split("")}
34 32.times {vote_array << "BCAD".split("")}
35 14.times {vote_array << "CABD".split("")}
36 49.times {vote_array << "CBAD".split("")}
37 17.times {vote_array << "ABDC".split("")}
38 23.times {vote_array << "BADC".split("")}
39 37.times {vote_array << "BCDA".split("")}
40 11.times {vote_array << "CADB".split("")}
41 16.times {vote_array << "CBDA".split("")}
42 54.times {vote_array << "ADBC".split("")}
43 36.times {vote_array << "BDCA".split("")}
44 42.times {vote_array << "CDAB".split("")}
45 13.times {vote_array << "CDBA".split("")}
46 51.times {vote_array << "DABC".split("")}
47 33.times {vote_array << "DBCA".split("")}
48 39.times {vote_array << "DCAB".split("")}
49 12.times {vote_array << "DCBA".split("")}
51 test_winner( "C", InstantRunoffVote.new(vote_array).result )