Ejemplo n.º 1
0
        public void TestGetNeighbors_DoesNotWrap_PositiveY()
        {
            // Arrange
            int maxX = 3;
            int maxY = 3;

            Tile[,] tiles = new Tile[maxX, maxY];
            for (int x = 0; x < maxX; x++)
            {
                for (int y = 0; y < maxY; y++)
                {
                    var tile = new Tile
                    {
                        X = x,
                        Y = y
                    };
                    tiles[x, y] = tile;
                }
            }

            // Act
            List <Tile> neighbors = TileHelpers.GetSurrounding(tiles, maxX, maxY, tiles[1, 2]);

            // Assert
            Assert.AreEqual(8, neighbors.Count);
        }