public void CanTestMiniMaxEarlyGameAsX() { // arrange BoardTests BST = new BoardTests(); // act int result = engine.MiniMax(board, 0, 'X'); // assert Assert.Equal(0, result); }
public void CanTestMiniMaxEarlyGameAs0() { // arrange BoardTests BST = new BoardTests(); board.Cells[8].Symbol = 'X'; // act int result = engine.MiniMax(board, 1, '0'); // assert Assert.Equal(-1, result); }
public void CanWinLeftCol() { // arrange BoardTests BST = new BoardTests(); board.Cells[0].Symbol = 'X'; board.Cells[3].Symbol = 'X'; // act Tuple <bool, int> result = engine.Utility(board, 6, 'X'); // assert Assert.Equal(-1, result.Item2); }
public void CanWinBottomRow() { // arrange BoardTests BST = new BoardTests(); board.Cells[6].Symbol = 'X'; board.Cells[7].Symbol = 'X'; // act Tuple <bool, int> result = engine.Utility(board, 8, 'X'); // assert Assert.Equal(-1, result.Item2); }
public void CanLoseAntiDiag() { // arrange BoardTests BST = new BoardTests(); board.Cells[2].Symbol = '0'; board.Cells[4].Symbol = '0'; board.Cells[6].Symbol = '0'; // act Tuple <bool, int> result = engine.Utility(board, 7, 'X'); // assert Assert.Equal(1, result.Item2); }
public void CanLoseRightCol() { // arrange BoardTests BST = new BoardTests(); board.Cells[2].Symbol = '0'; board.Cells[5].Symbol = '0'; board.Cells[8].Symbol = '0'; // act Tuple <bool, int> result = engine.Utility(board, 0, 'X'); // assert Assert.Equal(1, result.Item2); }
public void CanLoseMiddleCol() { // arrange BoardTests BST = new BoardTests(); board.Cells[1].Symbol = '0'; board.Cells[4].Symbol = '0'; board.Cells[7].Symbol = '0'; // act Tuple <bool, int> result = engine.Utility(board, 8, 'X'); // assert Assert.Equal(1, result.Item2); }
public void CanTestMiniMaxMidGameAsX() { // arrange BoardTests BST = new BoardTests(); board.Cells[0].Symbol = 'X'; board.Cells[4].Symbol = '0'; board.Cells[3].Symbol = 'X'; board.Cells[6].Symbol = '0'; // act int result = engine.MiniMax(board, 8, 'X'); // assert Assert.Equal(1, result); }
public void CanTestMiniMaxLateGameLossAs0() { // arrange BoardTests BST = new BoardTests(); board.Cells[0].Symbol = 'X'; board.Cells[1].Symbol = '0'; board.Cells[2].Symbol = 'X'; board.Cells[3].Symbol = '0'; board.Cells[4].Symbol = 'X'; board.Cells[5].Symbol = '0'; board.Cells[6].Symbol = 'X'; // act int result = engine.MiniMax(board, 8, '0'); // assert Assert.Equal(-1, result); }
public void CanTieGame() { // arrange BoardTests BST = new BoardTests(); board.Cells[0].Symbol = 'X'; board.Cells[1].Symbol = '0'; board.Cells[2].Symbol = 'X'; board.Cells[3].Symbol = '0'; board.Cells[4].Symbol = '0'; board.Cells[5].Symbol = 'X'; board.Cells[6].Symbol = 'X'; board.Cells[7].Symbol = 'X'; // act Tuple <bool, int> result = engine.Utility(board, 8, '0'); // assert Assert.Equal(0, result.Item2); }