Exemple #1
0
        public void 장애물_타일은_표시가_안되는지_확인()
        {
            List <Point> answerPoints = new List <Point>
            {
                new Point(0, 3), new Point(1, 2), new Point(1, 4), new Point(2, 1),
                new Point(2, 3), new Point(2, 5), new Point(3, 0), new Point(3, 2),
                new Point(3, 4), new Point(3, 6), new Point(4, 1), new Point(4, 3),
                new Point(4, 5), new Point(5, 2), new Point(5, 4), new Point(6, 3)
            };

            List <Point> obstaclePoints = new List <Point>
            {
                new Point(2, 5), new Point(3, 6), new Point(4, 1), new Point(5, 4), new Point(1, 2)
            };

            var finalPoints = answerPoints.Except(obstaclePoints).ToList();

            Board board = TileFinder.RemoveDisableTiles(new Point(3, 3), 3, new Board(7, 7));

            List <Point> movablePoints = new List <Point>();

            for (int x = 0; x < board.Points.GetLength(0); x++)
            {
                for (int y = 0; y < board.Points.GetLength(1); y++)
                {
                    if (board.Points[x, y].isMovable)
                    {
                        movablePoints.Add(board.Points[x, y]);
                    }
                }
            }

            for (int i = 0; i < movablePoints.Count; i++)
            {
                Assert.IsTrue(movablePoints[i].Equals(finalPoints[i]));
            }
        }