final boolean searchResult1 = pathfinder.searchNodePath(graph.nodes.get(15), graph.nodes.get(25), new ManhattanDistance(), outPath); final boolean searchResult2 = pathfinder.searchNodePath(graph.nodes.get(15), graph.nodes.get(16), new ManhattanDistance(), outPath); final boolean searchResult3 = pathfinder.searchNodePath(graph.nodes.get(15), graph.nodes.get(14), new ManhattanDistance(), outPath); final boolean searchResult4 = pathfinder.searchNodePath(graph.nodes.get(15), graph.nodes.get(5), new ManhattanDistance(), outPath);
final boolean searchResult = pathfinder.searchNodePath(graph.nodes.get(0), graph.nodes.get(212), new ManhattanDistance(), outPath);
@Test public void searchNodePath_WhenDestinationUnreachable_ExpectedNoOuputPathFound () { // @off - disable libgdx formatter final String graphDrawing = ".....#....\n" + ".....#....\n" + ".....#...."; // @on - enable libgdx formatter final MyGraph graph = createGraphFromTextRepresentation(graphDrawing); final IndexedAStarPathFinder<MyNode> pathfinder = new IndexedAStarPathFinder<>(graph); final GraphPath<MyNode> outPath = new DefaultGraphPath<>(); // @off - disable libgdx formatter // 0123456789 // S....#...E 0 // .....#.... 10 // .....#.... 20 // @on - enable libgdx formatter final boolean searchResult = pathfinder.searchNodePath(graph.nodes.get(0), graph.nodes.get(9), new ManhattanDistance(), outPath); Assert.assertFalse("Unexpected search result", searchResult); }