public void TestIntitialize() { testBoard = new Pente.Models.Board(); testPlayer = new Pente.Models.Player("Dubya", Pente.Enums.PlayerOrderEnum.PLAYER2); testPlayer.pieceChar = 'X'; //gamePage = new Pente.GamePage("Dubya", "Topher", 19, 19); }
public void RemovePiecesTest_CanRemoveUp_ShouldReturnValid() { testBoard.GameBoard[3, 0].TokenXY = "X"; testBoard.GameBoard[1, 0].TokenXY = "Y"; testBoard.GameBoard[2, 0].TokenXY = "Y"; Pente.Models.Board tempBoard = new Pente.Models.Board(); tempBoard.GameBoard[3, 0].TokenXY = "X"; tempBoard.GameBoard[1, 0].TokenXY = "Y"; tempBoard.GameBoard[2, 0].TokenXY = "Y"; int[] testMove = { 0, 0 }; Pente.GameProcesses.GameRules.RemovePieces(testPlayer, testBoard, testMove); Assert.AreNotEqual(testBoard.GameBoard[1, 0], tempBoard.GameBoard[1, 0]); Assert.AreNotEqual(testBoard.GameBoard[2, 0], tempBoard.GameBoard[2, 0]); }
public void RemovePiecesTest_CanRemoveDiagonalDownRight_ShouldReturnValid() { testBoard.GameBoard[5, 5].TokenXY = "X"; testBoard.GameBoard[6, 6].TokenXY = "Y"; testBoard.GameBoard[7, 7].TokenXY = "Y"; Pente.Models.Board tempBoard = new Pente.Models.Board(); tempBoard.GameBoard[5, 5].TokenXY = "X"; tempBoard.GameBoard[6, 6].TokenXY = "Y"; tempBoard.GameBoard[7, 7].TokenXY = "Y"; int[] testMove = { 8, 8 }; Pente.GameProcesses.GameRules.RemovePieces(testPlayer, testBoard, testMove); Assert.AreNotEqual(testBoard.GameBoard[6, 6], tempBoard.GameBoard[6, 6]); Assert.AreNotEqual(testBoard.GameBoard[7, 7], tempBoard.GameBoard[7, 7]); }
public void RemovePiecesTest_CanRemoveDiagonalUpLeft_ShouldReturnValid() { testBoard.GameBoard[5, 5].TokenXY = "X"; testBoard.GameBoard[4, 4].TokenXY = "Y"; testBoard.GameBoard[3, 3].TokenXY = "Y"; Pente.Models.Board tempBoard = new Pente.Models.Board(); tempBoard.GameBoard[5, 5].TokenXY = "X"; tempBoard.GameBoard[4, 4].TokenXY = "Y"; tempBoard.GameBoard[3, 3].TokenXY = "Y"; int[] testMove = { 2, 2 }; Pente.GameProcesses.GameRules.RemovePieces(testPlayer, testBoard, testMove); for (int i = 0; i < 19; i++) { Assert.AreNotEqual(testBoard.GameBoard[4, 4], tempBoard.GameBoard[4, 4]); } Assert.AreNotEqual(testBoard.GameBoard[3, 3], tempBoard.GameBoard[3, 3]); }
public void RemovePiecesTest_NothingToRemove_ShouldReturnInvalid() { testBoard.GameBoard[0, 0].TokenXY = "X"; testBoard.GameBoard[0, 1].TokenXY = "Y"; testBoard.GameBoard[0, 2].TokenXY = "Y"; Pente.Models.Board tempBoard = new Pente.Models.Board(); tempBoard.GameBoard[0, 0].TokenXY = "X"; tempBoard.GameBoard[0, 1].TokenXY = "Y"; tempBoard.GameBoard[0, 2].TokenXY = "Y"; int[] testMove = { 0, 4 }; Pente.GameProcesses.GameRules.RemovePieces(testPlayer, testBoard, testMove); for (int i = 0; i < testBoard.rowCount; i++) { for (int j = 0; j < testBoard.colCount; j++) { Assert.AreEqual(testBoard.GameBoard[i, j].TokenXY, tempBoard.GameBoard[i, j].TokenXY); } } }