Example #1
0
        public void ClearTest()
        {
            HexBoard hexBoard = new HexBoard(BoardSize);

            // set a cell
            hexBoard.PlayMove(1, 1, true);
            Assert.AreEqual(Occupied.PlayerX, hexBoard.GetCellOccupiedAt(1, 1));

            Location loc11 = new Location(1, 1);
            Assert.AreEqual(Occupied.PlayerX, hexBoard.GetCellOccupiedAt(1, 1));
            Assert.AreEqual(Occupied.PlayerX, hexBoard.GetCellOccupiedAt(loc11));

            // reset it
            hexBoard.Clear();
            Assert.AreEqual(Occupied.Empty, hexBoard.GetCellOccupiedAt(1, 1));
            Assert.AreEqual(Occupied.Empty, hexBoard.GetCellOccupiedAt(loc11));
        }