public void Test_Board_MakeMove_OccupiedPosition() { 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 board = new UltimateBoard(); board.ParseFromString(boardString); // This position is occupied var move = new Move(1, 0); board.MakeMove(move, UltimateBoard.PlayerX); }
public void Test_Board_MakeMove_TieMove() { var boardString = "X.X|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 board = new UltimateBoard(); board.ParseFromString(boardString); // Tie the upper-left corner of microboard var move = new Move(1, 0); board.MakeMove(move, UltimateBoard.PlayerO); Assert.IsTrue(board.Macroboard[0, 0] == UltimateBoard.Tied); }
public void Test_Board_MakeMove_PlayerXWins() { // Make winning move in upper-left microboard var boardString = "X.X|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 board = new UltimateBoard(); board.ParseFromString(boardString); // Win the microboard var move = new Move(1, 0); board.MakeMove(move, UltimateBoard.PlayerX); // X won upper-left corner of macroboard Assert.IsTrue(board.Macroboard[0, 0] == UltimateBoard.PlayerX); }