Example #1
0
 /** Test method to check for the manhattan distance between two coordinates. */
 @Test
 public void testManhattanDistance() {
   assertEquals(
       "Return the manhattan distance, should return 3",
       3,
       PathNode.manhattanDistance(coords1, coords2));
 }
Example #2
0
 /** Method to test getFCost accessor method, which returns the sum of gCost & hCost. */
 @Test
 public void testGetFCost() {
   PathNode nodeTest = new PathNode(coords1, node2, coords3, 10);
   int fCost = PathNode.manhattanDistance(coords1, coords3) + 10;
   assertEquals("gCost + hCost = fCost", fCost, nodeTest.getFCost());
 }