private void button_newGame_Click(object sender, RoutedEventArgs e) { canvas_play.Children.Clear(); InitializeField(); queueTeam = 1; mainLogic = new TicTacToeLogic(); label_queue.Content = "Ходит: X"; }
public void Test_IsDraw_NoDraw1_CurrectResult() { logic = new TicTacToeLogic(); MakeTeamWonInOneCellDiag(0, 1, 1); MakeTeamWonInOneCellDiag(0, 2, 1); MakeTeamWonInOneCellDiag(0, 0, 1); Assert.IsFalse(logic.IsDraw()); }
public void Test_IsDraw_NoDraw2_CurrectResult() { logic = new TicTacToeLogic(); MakeFullOutsideCell(0, 0); MakeFullOutsideCell(1, 1); MakeFullOutsideCell(2, 2); MakeTeamWonInOneCellDiag(0, 1, 1); MakeTeamWonInOneCellDiag(0, 2, 1); MakeTeamWonInOneCellDiag(1, 2, 2); MakeTeamWonInOneCellDiag(1, 0, 2); MakeTeamWonInOneCellDiag(2, 0, 1); Assert.IsFalse(logic.IsDraw()); }
public void Test_IsFull_NotFull2_CurrectResult() { logic = new TicTacToeLogic(); MakeFullOutsideCell(0, 0); MakeFullOutsideCell(1, 1); MakeFullOutsideCell(2, 2); Assert.IsFalse(logic.IsFull()); }
public void Test_IsFull_NotFull1_CurrectResult() { logic = new TicTacToeLogic(); Assert.IsFalse(logic.IsFull()); }
public void Test_MakeMove_WonInOneCellDiag_CurrectResult() { logic = new TicTacToeLogic(); MakeTeamWonInOneCellDiag(0, 0, 1); Assert.AreEqual(1, logic.GetOutsideCell(0, 0)); }
public void Test_MakeMove_WonInOneCellRows_CurrectResult() { for (int i = 0; i < 3; i++) { logic = new TicTacToeLogic(); MakeTeamWonInOneCellRow(0, 0, 1, i); Assert.AreEqual(1, logic.GetOutsideCell(0, 0)); } }
public void Test_MakeMove_oneFullOutsideCell_currectResult() { logic = new TicTacToeLogic(); MakeFullOutsideCell(0, 0); Assert.IsTrue(logic.GetOutsideCell(0, 0) > 2); }
public void Test_MakeMove_simpleMove_currectResult() { logic = new TicTacToeLogic(); logic.MakeMove(0, 0, 0, 0, 1); Assert.AreEqual(1, logic.GetInsideCell(0, 0, 0, 0)); Assert.AreEqual(0, logic.GetOutsideCell(0, 0)); }
public void Test_MakeMove_makeSameMoveTwice_ThrowsExeption() { logic = new TicTacToeLogic(); logic.MakeMove(0, 0, 0, 0, 1); logic.MakeMove(0, 0, 0, 0, 2); }
public void Test_MakeMove_makeMoveWrongTeam_ThrowsExection() { logic = new TicTacToeLogic(); logic.MakeMove(0, 0, 1, 2, 3); }
public void Test_MakeMove_makeMoveWrongOutSideIndex_ThrowsExection() { logic = new TicTacToeLogic(); logic.MakeMove(0, 3, 2, 2, 1); }
public void Test_MakeMove_makeMoveInFinishedCell_ThrowsExection() { logic = new TicTacToeLogic(); MakeTeamWonInOneCellDiag(0, 0, 1); logic.MakeMove(0, 0, 1, 2, 2); }
public void Test_IsWon_Won2_CurrectResult() { logic = new TicTacToeLogic(); MakeTeamWonInOneCellDiag(1, 1, 2); MakeTeamWonInOneCellDiag(2, 2, 2); MakeTeamWonInOneCellDiag(0, 0, 2); Assert.IsTrue(logic.IsWon(2)); }