Ignore:
Timestamp:
Oct 26, 2010, 6:19:27 AM (14 years ago)
Author:
Rick van der Zwet
Message:

Some more usefull tests and debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • liacs/TOOS/assignment1/src/CensusTest.java

    r208 r209  
    1 package nl.rickvanderzwet.toos.assignment1;
    2 
    31import java.util.Calendar;
    42import java.util.HashSet;
     
    119
    1210    public void testEmptyVoteList() {
     11      HashSet<Voter> v = null;
    1312      Census c = new Census();
    14       assertTrue(c.census(null).equals(null));   
     13      assertTrue(c.census(v).equals(null));   
    1514    }
    16    
    17     public void testNoVote() {
    18         fail("An error message");
     15
     16    public void testAllPositiveVote() {
     17      HashSet<Voter> v = new HashSet<Voter>();
     18      v.add(new Voter(true));
     19      v.add(new Voter(true));
     20      v.add(new Voter(true));
     21      v.add(new Voter(true));
     22
     23      Census c = new Census();
     24      assertTrue(c.census(v));   
    1925    }
    20    
     26
     27    public void testNegativeVote() {
     28      HashSet<Voter> v = new HashSet<Voter>();
     29      v.add(new Voter(true));
     30      v.add(new Voter(true));
     31      v.add(new Voter(false));
     32      v.add(new Voter(true));
     33
     34      Census c = new Census();
     35      assertFalse(c.census(v));   
     36    }
    2137}
Note: See TracChangeset for help on using the changeset viewer.