package me.teaisaweso.shared;

import junit.framework.Assert;
import junit.framework.TestCase;

public class EdgeTest extends TestCase {

	private Vertex mV1, mV2, mV3;

	public void setUp() throws Exception {
		mV1 = new Vertex("a");
		mV2 = new Vertex("b");
		mV3 = new Vertex("c");
	}

	/**
	 * tests that a both edge has the right properties with the implicit
	 * constructor
	 */
	public void testBothEdgeImplicit() {
		Edge e1 = new Edge(mV1, mV2);
		Assert.assertEquals(true, e1.exits(mV1));
		Assert.assertEquals(true, e1.enters(mV2));
		Assert.assertEquals(true, e1.exits(mV2));
		Assert.assertEquals(true, e1.enters(mV1));
		Assert.assertEquals(false, e1.enters(mV3));
		Assert.assertEquals(false, e1.exits(mV3));
	}

	/**
	 * tests that a both edge has the right properties with an explict
	 * constructor
	 */
	public void testBothEdgeExplicit() {
		Edge e1 = new Edge(mV2, mV3, VertexDirection.both);
		Assert.assertEquals(true, e1.exits(mV2));
		Assert.assertEquals(true, e1.enters(mV3));
		Assert.assertEquals(true, e1.exits(mV3));
		Assert.assertEquals(true, e1.enters(mV2));
		Assert.assertEquals(false, e1.enters(mV1));
		Assert.assertEquals(false, e1.exits(mV1));
	}


}

@@ -1180,11 +1180,476 @@
 ));%0A%09%7D%0A%0A
+%09/**%0A%09 * tests a from-to edge has the right properties with an explicit%0A%09 * constructor%0A%09 */%0A%09public void testFromToEdgeExplicit() %7B%0A%09%09Edge e1 = new Edge(mV2, mV1, VertexDirection.fromTo);%0A%09%09Assert.assertEquals(true, e1.exits(mV2));%0A%09%09Assert.assertEquals(true, e1.enters(mV1));%0A%0A%09%09Assert.assertEquals(false, e1.exits(mV1));%0A%09%09Assert.assertEquals(false, e1.enters(mV2));%0A%0A%09%09Assert.assertEquals(false, e1.enters(mV3));%0A%09%09Assert.assertEquals(false, e1.exits(mV3));%0A%09%7D%0A
 %0A%7D%0A

add a test for from-to edges