Example #1
0
        public void TestingNewBoard()
        {
            //Arrange

            IUI ui = new MockUI();
            GameLogic GLnewgame = new GameLogic(ui);
            GLnewgame.NewBoard();

            //Act
            Board ActualBoard;
            ActualBoard = GLnewgame.GetGameBoard();

            //Assert
            Assert.IsInstanceOf<Board>(ActualBoard);
        }
Example #2
0
        /// <summary>
        /// Saves options to file, and resets the board
        /// </summary>
        void SaveData()
        {
            // put all values to game values
            game.BoardSize        = sliderBoardSize.Value;
            game.Players[0].Name  = txtPlayerNameX.Text;
            game.Players[0].IsCPU = checkCPUX.Checked;
            game.Players[1].IsCPU = checkCPUO.Checked;
            game.Players[1].Name  = txtPlayerNameO.Text;
            game.Delays           = chkThinkTime.Checked;
            game.AutomaticWinLose = chkAutomaticWinLoss.Checked;

            // save options to file
            game.SaveOptions(game.Delays, game.AutomaticWinLose, game.BoardSize, game.Players);

            // reset the board
            game.NewBoard();
        }