package beaform.entities;

import org.junit.Test;

import junit.framework.TestCase;

/**
 * Test for the formula tag.
 * @author Steven Post
 *
 */
public class FormulaTagTest extends TestCase {

	@Test
	public static void testEquals() {
		final FormulaTag tag1 = new FormulaTag("test");
		final FormulaTag tag2 = new FormulaTag("test");
		assertEquals("The tags are not equal", tag1, tag2);
	}

	@Test
	public static void testNotEqual() {
		final FormulaTag tag1 = new FormulaTag("test1");
		final FormulaTag tag2 = new FormulaTag("test2");
		assertFalse("The tags are equal", tag1.equals(tag2));
	}

	/**
	 * Test hash.
	 */
	@Test
	public static void testEqualsHash() {
		final FormulaTag tag1 = new FormulaTag("test");
		final FormulaTag tag2 = new FormulaTag("test");
		assertEquals("The tags are not equal", tag1.hashCode(), tag2.hashCode());
	}

	/**
	 * Test not equals.
	 */
	@Test
	public static void testNotEqualsHash() {
		final FormulaTag tag1 = new FormulaTag("test1");
		final FormulaTag tag2 = new FormulaTag("test2");
		assertFalse("The tags are equal", tag1.hashCode() == tag2.hashCode());
	}

}

@@ -424,120 +424,489 @@
 test
-NotEqual() %7B%0A%09%09final FormulaTag tag1 = new FormulaTag(%22test1%22);%0A%09%09final FormulaTag tag2 = new FormulaTag(%22test2%22
+EqualsSameObject() %7B%0A%09%09final FormulaTag tag1 = new FormulaTag(%22test%22);%0A%09%09assertTrue(%22The tags are not equal%22, tag1.equals(tag1));%0A%09%7D%0A%0A%09@Test%0A%09public static void testNotEqual() %7B%0A%09%09final FormulaTag tag1 = new FormulaTag(%22test1%22);%0A%09%09final FormulaTag tag2 = new FormulaTag(%22test2%22);%0A%09%09assertFalse(%22The tags are equal%22, tag1.equals(tag2));%0A%09%7D%0A%0A%09@Test%0A%09public static void testNotEqualDifferentType() %7B%0A%09%09final FormulaTag tag1 = new FormulaTag(%22test1%22);%0A%09%09final Object tag2 = new Object(
 );%0A%09

Add more tests for the FormulaTag.equals() method