package org.psjava.algo.graph.pathfinder;

import org.junit.Assert;
import org.junit.Test;
import org.psjava.ds.Collection;
import org.psjava.ds.graph.NewGraphFromGraph;
import org.psjava.ds.graph.DirectedEdge;
import org.psjava.ds.graph.OldGraph;
import org.psjava.ds.graph.TestGraphFactory;

public class DFSPathFinderTest {

	@Test
	public void test() {
		OldGraph<String, DirectedEdge<String>> g = TestGraphFactory.createDirected(new String[][] { { "A", "B" }, { "B", "C" }, { "C", "D" } });
		Collection<DirectedEdge<String>> r = DFSPathFinder.getInstance().find(NewGraphFromGraph.createFromDirected(g), "A", "C", null);
		Assert.assertEquals("(A->B,B->C)", r.toString());
	}

	@Test
	public void testNoPath() {
		OldGraph<String, DirectedEdge<String>> g = TestGraphFactory.createDirected(new String[][] { { "A", "B" }, { "C", "D" } });
		Collection<DirectedEdge<String>> r = DFSPathFinder.getInstance().find(NewGraphFromGraph.createFromDirected(g), "A", "C", null);
		Assert.assertNull(r);
	}

}

@@ -149,28 +149,16 @@
 s.graph.
-NewGraphFrom
 Graph;%0D%0A
@@ -203,46 +203,8 @@
 e;%0D%0A
-import org.psjava.ds.graph.OldGraph;%0D%0A
 impo
@@ -308,35 +308,32 @@
 oid test() %7B%0D%0A%09%09
-Old
 Graph%3CString, Di
@@ -379,32 +379,35 @@
 y.createDirected
+New
 (new String%5B%5D%5B%5D 
@@ -530,47 +530,9 @@
 ind(
-NewGraphFromGraph.createFromDirected(g)
+g
 , %22A
@@ -649,11 +649,8 @@
 %0D%0A%09%09
-Old
 Grap
@@ -716,16 +716,19 @@
 Directed
+New
 (new Str
@@ -845,47 +845,9 @@
 ind(
-NewGraphFromGraph.createFromDirected(g)
+g
 , %22A

introduce new graph to DFSPathFinderTest.java