Exemplo n.º 1
0
 public void testOnCreationBoardIsEmpty()
 {
     Assert.AreEqual(TicTacToeState.EMPTY, state.getValue(0, 0));
     Assert.AreEqual(TicTacToeState.EMPTY, state.getValue(0, 2));
     Assert.AreEqual(TicTacToeState.EMPTY, state.getValue(2, 0));
     Assert.AreEqual(TicTacToeState.EMPTY, state.getValue(2, 2));
     Assert.AreEqual(true, state.isEmpty(0, 0));
     Assert.AreEqual(true, state.isEmpty(2, 2));
 }
Exemplo n.º 2
0
 public void testMakingTwoMovesChangesState()
 {
     state = game.GetResult(state, new XYLocation(0, 0));
     state = game.GetResult(state, new XYLocation(0, 1));
     Assert.AreEqual(TicTacToeState.O, state.getValue(0, 1));
     Assert.AreEqual(false, state.isEmpty(0, 1));
     Assert.AreEqual(true, state.isEmpty(1, 0));
     Assert.AreEqual(7, game.GetActions(state).Size());
     Assert.AreEqual(TicTacToeState.X, game.GetPlayer(state));
 }