public void ShouldRespectMovementPattern() { var grid = GridCatalog.GridWithObstructedDiagonals(); var path = grid.GetPath(new Position(0, 0), new Position(8, 8), MovementPatterns.LateralOnly, AgentShapes.Dot); Assert.NotNull(path); Assert.Empty(path); }
public void NonExistingPathShouldReturnEmtpyArray() { var grid = GridCatalog.GridWithEnclosedCenterTile(); var path = grid.GetPath(new Position(0, 0), new Position(4, 4)); Assert.NotNull(path); Assert.Empty(path); }
public void ShouldRespectIterationLimit() { var grid = GridCatalog.UnobstructedGrid(); var path = grid.GetPath(new Position(0, 0), new Position(8, 8), MovementPatterns.Full, AgentShapes.Dot, 8); Assert.NotNull(path); Assert.Empty(path); }
public void ShouldFindPathWithNonZeroStartingPosition() { var grid = GridCatalog.UnobstructedGrid(); var path = grid.GetPath(new Position(3, 3), new Position(5, 3)); Assert.NotNull(path); Assert.Equal(3, path.Length); }
public void ShouldFindPathInUnobstructedGrid() { var grid = GridCatalog.UnobstructedGrid(); var path = grid.GetPath(new Position(0, 0), new Position(8, 8)); Assert.NotNull(path); Assert.Equal(9, path.Length); }
public void ShouldRespectCellCost() { var grid = GridCatalog.GridWithHighCostCenterTile(); var path = grid.GetPath(new Position(0, 0), new Position(8, 8)); Assert.NotNull(path); Assert.DoesNotContain(new Position(4, 4), path); Assert.Equal(10, path.Length); }
public void ShouldRespectBlockedCells() { var grid = GridCatalog.GridWithBlockedCenterTile(); var result = grid.TryGetPath(new Position(0, 0), new Position(8, 8), out Position[] path); Assert.NotNull(path); Assert.DoesNotContain(new Position(4, 4), path); Assert.Equal(10, path.Length); }