public void ProcessTest21203() { global::PathfindingAlgorithms.Algorithms.Astar.Astar astar; IEnumerable<ICell> iEnumerable; EuclidianHeuristic s0 = new EuclidianHeuristic(); StraightAdjacement s1 = new StraightAdjacement(); astar = AstarFactory.Create((IHeuristic)s0, (IAdjacement)s1); ICell[,] iCells = new ICell[1, 1]; ValueCell s2 = new ValueCell(default(Coordinates), 0); iCells[0, 0] = (ICell)s2; iEnumerable = this.ProcessTest(astar, iCells, default(Coordinates), default(Coordinates)); Assert.IsNotNull((object)astar); }
public void EuclidianDistTest() { var h = new EuclidianHeuristic(); Coordinates a = new Coordinates(0, 3); Coordinates b = new Coordinates(4, 0); Coordinates c = new Coordinates(0, 0); double ab = h.Heuristic(a, b); double ac = h.Heuristic(a, c); double bc = h.Heuristic(b, c); Assert.AreEqual(5.0, ab, 1e-5, "wrong distance"); Assert.AreEqual(3.0, ac, 1e-5, "wrong distance"); Assert.AreEqual(4.0, bc, 1e-5, "wrong distance"); }