コード例 #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);
        }
コード例 #2
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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #6
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);
        }
コード例 #7
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);
        }
コード例 #8
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);
        }