package graph.examples; import graph.Graph; import graph.Vertex; import org.junit.Test; import static org.junit.Assert.*; public class DirectedTest { public DirectedTest() { Directed example = new Directed(); graph = example.getGraph(); v1 = example.getV1(); v2 = example.getV2(); v3 = example.getV3(); v4 = example.getV4(); v5 = example.getV5(); v6 = example.getV6(); } @Test public void testRepresentation() { assertTrue(graph.isEdge(v1, v2)); assertTrue(graph.isEdge(v1, v4)); assertTrue(graph.isEdge(v2, v5)); assertTrue(graph.isEdge(v3, v5)); assertTrue(graph.isEdge(v3, v6)); assertTrue(graph.isEdge(v4, v2)); assertTrue(graph.isEdge(v5, v4)); assertTrue(graph.isEdge(v6, v6)); assertFalse(graph.isEdge(v2, v1)); assertFalse(graph.isEdge(v4, v1)); assertFalse(graph.isEdge(v5, v2)); assertFalse(graph.isEdge(v5, v3)); assertFalse(graph.isEdge(v6, v3)); assertFalse(graph.isEdge(v2, v4)); assertFalse(graph.isEdge(v4, v5)); assertFalse(graph.isEdge(v1, v5)); assertFalse(graph.isEdge(v5, v1)); assertFalse(graph.isEdge(v1, v3)); assertFalse(graph.isEdge(v3, v1)); System.out.println("\n" + graph.toString() + "\n"); } private Graph graph; private Vertex v1, v2, v3, v4, v5, v6; }