\i Infrastructure-TestHeader.sql

\echo '$Id: 0-integrity-TooManyWriteIns.sql 134 2007-03-20 21:44:42Z dflater $'
\echo
\echo 'Verify that ballots having VoterInput for more write-in Choices in a'
\echo 'given Contest than is allowed by the MaxWriteIns atttribute of the'
\echo 'Contest are detected by the integrity check.  The "All results should'
\echo 'be empty" notice does not apply to this test case.  Refer instead to'
\echo 'the "Expected results" printed at the bottom.'

\i 0-integrity-common.sql

update Choice set IsWriteIn = true where ChoiceId = 5;
update Contest set MaxWriteIns = 1 where ContestId = 2;

\i Infrastructure-IntegrityChecks.sql

\echo 'Expected results:'
\echo '          Too Many Write-Ins'
\echo ' ballotid | contestid | writeinscount '
\echo '----------+-----------+---------------'
\echo '        6 |         2 |             2'
\echo '        7 |         2 |             2'
\echo '(2 rows)'

\i Infrastructure-TestFooter.sql
