示例#1
0
        public void Test_Board_GameStatus_OWon()
        {
            var boardString = "XXX|OOO|.XX|OXX|O..|OOO|OXO|..O|.OO|OXX|OOO|XOO|XXX|OX.|.XX|.O.|O..|OO.|O..|OOO|.OX|XXX|...|...|..O|XXO|XXX";
            var macroboard  = "TOO|XOT|XOX";
            var board       = new UltimateBoard();

            board.ParseFromString(boardString);
            board.ParseMacroboardFromString(macroboard);

            // Tie
            Assert.IsTrue(board.GetGameStatus() == UltimateBoard.GameStatus.OWon);
        }
示例#2
0
        public void Test_Board_GameStatus_MoreMovesAvailable()
        {
            var boardString = "XOX|XXX|.XX|OXX|O..|OOO|OXO|..O|.OO|OXX|OOO|XOO|XXX|OX.|.XX|.O.|O..|OO.|O..|OOO|.OX|XXX|...|...|..O|XXO|XXX";
            var macroboard  = "TXO|XOA|XOX";
            var board       = new UltimateBoard();

            board.ParseFromString(boardString);
            board.ParseMacroboardFromString(macroboard);

            // More moves available in center-right of microboard
            Assert.IsTrue(board.GetGameStatus() == UltimateBoard.GameStatus.MovesAvailable);
        }