コード例 #1
0
ファイル: ZoneMapTests.cs プロジェクト: raboley/Pathfinder
        public void TestPrintSmallGridWithObstacles()
        {
            const string want = @"
-------------------
|  x  |  x  |     |
-------------------
|  x  |  x  |     |
-------------------
|     |     |     |
-------------------
";

            // var MapGrid = SetupSmallGrid();
            var grid = SetupZoneMap.SetupSmallGrid();
            var pos1 = new Vector3(0, 0, 1);
            var pos2 = new Vector3(-1, 0, 1);
            var pos3 = new Vector3(-1, 0, 0);

            grid.AddUnWalkableNode(Vector3.Zero);
            grid.AddUnWalkableNode(pos1);
            grid.AddUnWalkableNode(pos2);
            grid.AddUnWalkableNode(pos3);
            string got = grid.Print();

            SetupZoneMap.AssertPointNotWalkable(grid, pos1);
            SetupZoneMap.AssertPointNotWalkable(grid, pos2);
            SetupZoneMap.AssertPointNotWalkable(grid, pos3);

            Assert.Equal(want, got);
        }