Example #1
0
        public void Othello_InitGame_GetGameTable()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetGameState();

            Assert.AreEqual(gameState.GetLength(0), 8);
            Assert.AreEqual(gameState.GetLength(1), 8);
        }
        public void Othello_InitGame_GetGameTable()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetGameState();

            Assert.AreEqual(gameState.GetLength(0), 8);
            Assert.AreEqual(gameState.GetLength(1), 8);
        }
Example #3
0
        public void Othello_Play_CurrentPlayerIsBlackOrWhite_NextPlayerColorIsTheOther(CaseState color1, CaseState color2)
        {
            Othello othello = new Othello(color1);

            CaseState caseState = othello.CurrentPlayerColor;

            othello.Play();

            Assert.AreEqual(caseState, color1);
            Assert.AreEqual(othello.CurrentPlayerColor, color2);
        }
Example #4
0
        public void Othello_InitGame_VerifyPositionOfFirstPieces()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetGameState();

            Assert.AreEqual(gameState[4, 4], CaseState.Black);
            Assert.AreEqual(gameState[4, 5], CaseState.White);
            Assert.AreEqual(gameState[5, 4], CaseState.White);
            Assert.AreEqual(gameState[5, 5], CaseState.Black);
        }
Example #5
0
        public void Othello_GetAvailablePositions()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetAvailablePositions();

            Assert.AreEqual(gameState[3, 4], CaseState.Available);
            Assert.AreEqual(gameState[4, 3], CaseState.Available);
            Assert.AreEqual(gameState[5, 6], CaseState.Available);
            Assert.AreEqual(gameState[6, 5], CaseState.Available);
        }
        public void Othello_GetAvailablePositions()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetAvailablePositions();

            Assert.AreEqual(gameState[3, 4], CaseState.Available);
            Assert.AreEqual(gameState[4, 3], CaseState.Available);
            Assert.AreEqual(gameState[5, 6], CaseState.Available);
            Assert.AreEqual(gameState[6, 5], CaseState.Available);
        }
        public void Othello_InitGame_VerifyPositionOfFirstPieces()
        {
            Othello othello = new Othello();

            CaseState[,] gameState = othello.GetGameState();

            Assert.AreEqual(gameState[4, 4], CaseState.Black);
            Assert.AreEqual(gameState[4, 5], CaseState.White);
            Assert.AreEqual(gameState[5, 4], CaseState.White);
            Assert.AreEqual(gameState[5, 5], CaseState.Black);
        }
        public void Othello_Play_CurrentPlayerIsBlackOrWhite_NextPlayerColorIsTheOther(CaseState color1, CaseState color2)
        {
            Othello othello = new Othello(color1);

            CaseState caseState = othello.CurrentPlayerColor;

            othello.Play();

            Assert.AreEqual(caseState, color1);
            Assert.AreEqual(othello.CurrentPlayerColor, color2);
        }