package edu.duke.cabig.c3pr.domain;

import edu.duke.cabig.c3pr.AbstractTestCase;

public class MutableDeletableDomainObjectTest extends AbstractTestCase{

	class TestAbstractMutableDeletableDomainObject extends AbstractMutableDeletableDomainObject{
		
	}
	/*
	 * this method test equals method
	 * this will check equality, id other obj is null
	 */
	public void testEquals(){
		AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();
		assertFalse("objects are not same because comparing with null",obj1.equals(null));
	}
	
	/*
	 * this method test equals method
	 * this will check equality based on retired indicator.
	 */
	public void testEquals1(){
		AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();
		AbstractMutableDeletableDomainObject  obj2 = new AbstractMutableDeletableDomainObject();
		
		obj2.setRetiredIndicatorAsTrue();
		assertFalse("objects are not same because obj1 has null retired indicator while obj2 has true",obj1.equals(obj2));
		
	}


	/*
	 * this method test equals method
	 * this will check equality based on retired indicator.
	 */
	public void testEquals2(){
		AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();
		AbstractMutableDeletableDomainObject  obj2 = new AbstractMutableDeletableDomainObject();
		obj1.setRetiredIndicatorAsFalse();
		obj2.setRetiredIndicatorAsTrue();
		assertFalse("objects are not same because obj1 has false retired indicator while obj2 has true",obj1.equals(obj2));
		
	}
	

	/*
	 * this method test equals method
	 * this will check equality based on retired indicator.
	 */
	public void testEquals3(){
		AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();
		AbstractMutableDeletableDomainObject  obj2 = new AbstractMutableDeletableDomainObject();
		obj1.setRetiredIndicatorAsTrue();
		obj2.setRetiredIndicatorAsTrue();
		assertTrue("objects are same because retired indictaor is true for both objects",obj1.equals(obj2));
		
	}



}





@@ -2030,16 +2030,907 @@
 ;%0A%09%09%0A%09%7D%0A
+%09%0A%09/*%0A%09 * this method test equals method%0A%09 * this will check equality based on retired indicator.%0A%09 */%0A%09public void testEquals4()%7B%0A%09%09AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();%0A%09%09AbstractMutableDeletableDomainObject  obj2 = new AbstractMutableDeletableDomainObject();%0A%09%09obj2.setRetiredIndicatorAsTrue();%0A%09%09assertFalse(%22objects are not same because retired indictaor is different for both objects%22,obj1.equals(obj2));%0A%09%09%0A%09%7D%0A%09%0A%0A%09/*%0A%09 * this method test equals method%0A%09 * this will check equality based on retired indicator.%0A%09 */%0A%09public void testEquals5()%7B%0A%09%09AbstractMutableDeletableDomainObject  obj1 = new AbstractMutableDeletableDomainObject();%0A%09%09AbstractMutableDeletableDomainObject  obj2 = new AbstractMutableDeletableDomainObject();%0A%09%09assertTrue(%22objects are same because retired indictaor is null for both objects%22,obj1.equals(obj2));%0A%09%09%0A%09%7D%0A
 %0A%0A%0A%7D%0A%0A%0A%0A

test coverage improvement