/** * */ package net.ihe.xcpd.init.model; import java.sql.Date; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import junit.framework.TestCase; /** * @author aboufahj * */ public class AssertionTest extends TestCase { Assertion assertion; /** * @param name */ public AssertionTest(String name) { super(name); } /* (non-Javadoc) * @see junit.framework.TestCase#setUp() */ @BeforeMethod protected void setUp() throws Exception { super.setUp(); assertion = new Assertion(); } /* (non-Javadoc) * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } /** * Test method for {@link net.ihe.xcpd.init.model.Assertion#Assertion(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Date)}. */ @Test public void testAssertionStringStringStringStringDate() { assertion = new Assertion("1", new Date(2000, 12, 12)); assertEquals(assertion.getAssertionBody(), "1"); assertEquals(assertion.getCreationTime(), new Date(2000, 12, 12)); } /** * Test method for {@link net.ihe.xcpd.init.model.Assertion#setId(java.lang.Integer)}. */ @Test public void testSetId() { Integer i = new Integer(1); assertion.setId(i); assertEquals(assertion.getId(), i); } /** * Test method for {@link net.ihe.xcpd.init.model.Assertion#setAssertionBody(java.lang.String)}. */ @Test public void testSetAssertionBody() { String ass = new String("test"); assertion.setAssertionBody(ass); assertEquals(assertion.getAssertionBody(), ass); } /** * Test method for {@link net.ihe.xcpd.init.model.Assertion#setCreationTime(java.util.Date)}. */ @Test public void testSetCreationTime() { Date ass = new Date(2000, 01, 01); assertion.setCreationTime(ass); assertEquals(assertion.getCreationTime(), ass); } @Test() public void testEqualsObject() { Assertion ass1 = new Assertion("1", new Date(2000, 12, 12)); Assertion ass2 = new Assertion("1", new Date(2000, 12, 12)); assertEquals(ass1, ass2); } }