/** * IndividualTest.java * Test class for class Individual * * @Sharon Tuttle * @2-6-03 */ public class IndividualTest extends JPFalt { public static void main(String[] args) { new IndividualTest(); } /** Test suite for the class Individual **/ /*--------------------------------------------------------------- Define several Individual objects, print the member data values --------------------------------------------------------------*/ void TestIndividual() { println("\nDefine Inidividual objects, print member data values"); Individual person1 = new Individual("Smith", "Joe"); println(person1); println(person1.getZip()); Individual person2 = new Individual("Harper", "Ann", "222-3333", "222 2nd Street", "Arcata", "CA", "95521"); println("\n" + person2); println(person2.getZip()); Individual person3 = new Individual("Garza", "Roger", "333-4444", new MailingAddr("333 3rd Street", "Fortuna", "CA", "95540")); println("\n" + person3); println(person3.getZip()); } /*----------------------------------------------------------- Test method for hasAddress() --------------------------------------------------------------*/ void hasAddressTest() { Individual person1 = new Individual("Smith", "Joe"); Individual person2 = new Individual("Harper", "Ann", "222-3333", "222 2nd Street", "Arcata", "CA", "95521"); Individual person3 = new Individual("Garza", "Roger", "333-4444", new MailingAddr("333 3rd Street", "Fortuna", "CA", "95540")); testHeader("hasAddress"); expected(false); actual( person1.hasAddress() ); expected(true); actual( person2.hasAddress() ); expected(true); actual( person3.hasAddress() ); } }