package edu.duke.cabig.c3pr.domain;

import edu.duke.cabig.c3pr.AbstractTestCase;

public class SystemAssignedIdentifierTest extends AbstractTestCase{
	
	public void testCompareTo() throws Exception{
		
		SystemAssignedIdentifier identifier1 = new SystemAssignedIdentifier();
		identifier1.setSystemName("SystemA");
		
		SystemAssignedIdentifier identifier2 = new SystemAssignedIdentifier();
		identifier2.setSystemName("SystemB");
		
		SystemAssignedIdentifier identifier3 = new SystemAssignedIdentifier();
		identifier3.setSystemName("SystemA");
		
		assertEquals("These 2 identifiers cannot be same",1, identifier1.compareTo(identifier2));
		assertEquals("These 2 identifier are same",0, identifier1.compareTo(identifier3));
	}
	
	public void testEquals() throws Exception{
	        
		SystemAssignedIdentifier identifier1 = new SystemAssignedIdentifier();
		identifier1.setSystemName("SystemA");
		
		SystemAssignedIdentifier identifier2 = identifier1 ;
		assertTrue("These two identifiers are equal",identifier1.equals(identifier2));
		
		OrganizationAssignedIdentifier identifier3 = new OrganizationAssignedIdentifier(); 
		assertFalse("These two identifiers are  not equal",identifier1.equals(identifier3));
		
		SystemAssignedIdentifier identifier4 = new SystemAssignedIdentifier();
		assertFalse("These two identifiers cannot be equal",identifier4.equals(identifier1));
		
		SystemAssignedIdentifier identifier5 = new SystemAssignedIdentifier();
		identifier5.setSystemName("SystemA");
		assertTrue("These two identifiers are equal",identifier1.equals(identifier5));
		
		SystemAssignedIdentifier identifier6 = new SystemAssignedIdentifier();
		identifier6.setSystemName("SystemB");
		assertFalse("These two identifiers cannot be equal",identifier1.equals(identifier6));
	}
}

@@ -76,16 +76,99 @@
 tCase;%0A%0A
+// TODO: Auto-generated Javadoc%0A/**%0A * The Class SystemAssignedIdentifierTest.%0A */%0A
 public c
@@ -229,16 +229,47 @@
 Case%7B%0A%09%0A
+%09/**%0A%09 * Test compare to.%0A%09 */%0A
 %09public 
@@ -289,32 +289,16 @@
 areTo() 
-throws Exception
 %7B%0A%09%09%0A%09%09S
@@ -824,16 +824,43 @@
 );%0A%09%7D%0A%09%0A
+%09/**%0A%09 * Test equals.%0A%09 */%0A
 %09public 
@@ -881,24 +881,8 @@
 s() 
-throws Exception
 %7B%0A%09 

test case coverage improvement