package edu.duke.cabig.c3pr.domain;

import edu.duke.cabig.c3pr.AbstractTestCase;

public class OrganizationTest extends AbstractTestCase{
	
public void testCompareTo() throws Exception{
		
		Organization organization1 = new LocalHealthcareSite();
		organization1.setName("OrganizationA");

		Organization organization2 = new LocalHealthcareSite();
		organization2.setName("OrganizationB");

		Organization organization3 = new LocalHealthcareSite();
		organization3.setName("OrganizationB");
		
		assertEquals("These 2 organizations cannot be same",1, organization1.compareTo(organization2));
		assertEquals("These 2 organization are same",0, organization2.compareTo(organization3));
	}
	
	public void testEquals() throws Exception{
	        
		Organization organization1 = new LocalHealthcareSite();
		organization1.setName("OrganizationA");
		
		Organization organization2 = organization1;
		assertTrue("These two organizations are equal",organization1.equals(organization2));
		
		Epoch organization3 = new Epoch(); // making sure testing for different objects  
		assertFalse("These two organizations are  not equal",organization1.equals(organization3));
		
		Organization organization4 = new LocalHealthcareSite();
		assertFalse("These two organizations cannot be equal",organization4.equals(organization1));
		
		Organization organization5 = new LocalHealthcareSite();
		organization5.setName("OrganizationA");
		assertTrue("These two organizations are equal",organization1.equals(organization5));
		
		Organization organization6 = new LocalHealthcareSite();
		organization6.setName("OrganizationB");
		assertFalse("These two organizations cannot be equal",organization1.equals(organization6));
	}
	
	public void testGetTrimmedName(){
		Organization organization = new LocalHealthcareSite();
		organization.setName("Duke Hematology/Oncology at Raleigh Community Hospital");
		
		assertEquals("Trimmed name should be Duke Hematology/Oncology","Duke Hematology/Oncology", organization.getTrimmedName());

	}

}

@@ -30,16 +30,53 @@
 omain;%0A%0A
+import javax.persistence.Transient;%0A%0A
 import e
@@ -1906,27 +1906,24 @@
 Hospital%22);%0A
-%09%09%0A
 %09%09assertEqua
@@ -2000,16 +2000,19 @@
 Oncology
+...
 %22, organ
@@ -2038,15 +2038,1079 @@
 ame());%0A
-%0A
 %09
+%7D%0A%09%0A    public void testGetEndPointAuthenticationRequired()%7B%0A//        return this.getHasEndpointProperty() && this.studyEndPointProperty.getIsAuthenticationRequired() && this.registrationEndPointProperty.getIsAuthenticationRequired();%0A    %7D%0A    %0A    public void testSetEndPointAuthenticationRequired() %7B%0A//        this.studyEndPointProperty.setIsAuthenticationRequired(endPointAuthenticationRequired);%0A//        this.registrationEndPointProperty.setIsAuthenticationRequired(endPointAuthenticationRequired);%0A    %7D%0A    %0A    public void testGetHasEndpointProperty()%7B%0A    %09Organization organization = new LocalHealthcareSite();%0A    %09assertFalse(%22this organization doesnt have end point property%22, organization.getHasEndpointProperty());%0A    %09%0A    %09%0A    %09//        return studyEndPointProperty!=null && registrationEndPointProperty!=null;%0A    %7D%0A    %0A    public void testInitializeEndPointProperties()%7B%0A//        registrationEndPointProperty=new EndPointConnectionProperty(endPointType);%0A//        studyEndPointProperty=new EndPointConnectionProperty(endPointType);%0A    
 %7D%0A%0A%7D%0A

test case coverage improvement