AStarSearchTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.GameLogic.PathFinding.Tests AStarSearchTests

Namespace: DeltaEngine.GameLogic.PathFinding.Tests
Assembly: DeltaEngine.GameLogic.PathFinding.Tests (in DeltaEngine.GameLogic.PathFinding.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class AStarSearchTests

The AStarSearchTests type exposes the following members.

Constructors

  NameDescription
Public methodAStarSearchTests
Initializes a new instance of the AStarSearchTests class
Top
Methods

  NameDescription
Public methodCheckPathList
Public methodGraphWithNoNodesHasNoPath
Public methodInitialize
0 - 1 - 3 | | 2 4 - 5 View code on GitHub
Public methodSearchForPathBetweenNodes
Top
Examples

[Test]
public void SearchForPathBetweenNodes()
{
    Assert.IsTrue(aStar.Search(graph, 0, 2));
    Assert.IsTrue(aStar.Search(graph, 1, 5));
    Assert.IsFalse(aStar.Search(graph, 5, 2));
}
[Test]
public void GraphWithNoNodesHasNoPath()
{
    Assert.IsFalse(aStar.Search(new Graph(0), 0, 0));
}
[Test]
public void CheckPathList()
{
    aStar.Search(graph, 0, 2);
    Assert.AreEqual(2, aStar.GetPath().GetListOfCoordinates().Count);
    aStar.Search(graph, 1, 5);
    Assert.AreEqual(3, aStar.GetPath().GetListOfCoordinates().Count);
}
See Also