#! /usr/bin/perl -w
use strict;

package testCases;

require Exporter;

use vars qw( @ISA @EXPORT );
@ISA = qw( Exporter );
@EXPORT = qw( @TestSet );

# ======================================================================
# === only a subset of test cases shown until after assign2 comes in ===
# ======================================================================

our @TestSet = (

   # ================== TEST CASES FOR buildContactHash ===================================

   [  # empty contact list
      [ ],
      { },
      qr(All entries valid), 'contact list is empty', 'buildContactHash'
   ],

   [ # contact list containing a contact with extra fields
      [ [ 'me@here.now', '123-456-7890', 'extra' ] ],
      0,
      qr(Error: invalid contacts), 'contact with extra fields', 'buildContactHash'
   ],


   [ # valid contact list with a single entry
      [ [ 'me@here.now', '123-456-7890' ] ],
      { 'me@here.now' => '123-456-7890' },
      qr(All entries valid), 'single valid contact', 'buildContactHash'
   ],

   [ # valid contact list with two unique entries
      [ [ 'me@here.now', '123-456-7890' ], [ 'you@there.later', '250-555-1234' ] ],
      { 'me@here.now' => '123-456-7890', 'you@there.later' => '250-555-1234' },
      qr(All entries valid), 'two valid contacts', 'buildContactHash'
   ],


   [ # contact list containing duplicate email addresses
      [ [ 'me@here.now', '123-456-7890' ], [ 'me@here.now', '250-555-1234' ] ],
      { 'me@here.now' => '250-555-1234' },
      qr(Warning: duplicate email), 'duplicate email', 'buildContactHash'
   ]

);

1;
