package edu.duke.cabig.c3pr.domain;

import edu.duke.cabig.c3pr.AbstractTestCase;

public class PersonTestCase extends AbstractTestCase {
	
	class PersonSubClass extends Person{
		
	}
	
	private Person person ;
	
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		person = new PersonSubClass(); 
	}
	
	public void testGetEmailAsString(){
		assertNull("Email should come as null", person.getEmailAsString());
	}

	public void testGetEmailAsString1(){
		person.setEmail("test@best.com");
		assertNotNull("Email should not be null", person.getEmailAsString());
		assertEquals("Email id should be test@best.com", "test@best.com", person.getEmailAsString());
	}
	
	public void testGetEmailAsString2(){
		person.setFax("1234567890");
		assertNull("Email should be null", person.getEmailAsString());
	}
	
	public void testGetPhoneAsString(){
		assertNull("Phone should come as null", person.getPhoneAsString());
	}

	public void testGetPhoneAsString1(){
		person.setPhone("1234567890");
		assertNotNull("Phone should not be null", person.getPhoneAsString());
		assertEquals("Phone number should be 1234567890", "1234567890", person.getPhoneAsString());
	}
	
	public void testGetPhoneAsString2(){
		person.setFax("1234567890");
		assertNull("Phone should be null", person.getPhoneAsString());
	}
	
	public void testGetFaxAsString(){
		assertNull("Fax should come as null", person.getFaxAsString());
	}

	public void testGetFaxAsString1(){
		person.setFax("1234567890");
		assertNotNull("Fax should not be null", person.getFaxAsString());
		assertEquals("Fax number should be 1234567890", "1234567890", person.getFaxAsString());
	}
	
	public void testGetFaxAsString2(){
		person.setPhone("1234567890");
		assertNull("Fax should be null", person.getFaxAsString());
	}
	
}

@@ -30,16 +30,68 @@
 omain;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0A
 import e
@@ -1827,10 +1827,577 @@
 );%0A%09%7D%0A%09%0A
+%09public void testGetContactMechanism()%7B%0A%09%09ContactMechanism contactMechanism = registerMockFor(ContactMechanism.class);%0A%09%09List%3CContactMechanism%3E list = new ArrayList%3CContactMechanism%3E();%0A%09%09list.add(contactMechanism);%0A%09%09person.setContactMechanisms(list);%0A%09%09assertEquals(%221 contact mechnism found%22,1, person.getContactMechanisms().size());%0A%09%7D%0A%09%0A%09public void testGetFullName()%7B%0A%09%09person.setFirstName(%22First%22);%0A%09%09person.setMiddleName(%22Middle%22);%0A%09%09person.setLastName(%22Last%22);%0A%09%09assertEquals(%22Full name is First Middle Last%22,%22First Middle Last%22, person.getFullName());%0A%09%7D%0A%09%0A
 %7D%0A

test coverage improvement