private static void MakeNonWinningMove(Game game, int columnNumber, bool isYellow) { var board = new BoardAPI(Game.NUMBER_OF_COLUMNS, Game.NUMBER_OF_ROWS); board.MakeMove(game.Cells, columnNumber, isYellow); Assert.IsFalse(board.WasWinningMove(game.Cells, columnNumber, isYellow)); }
public void CheckPlayingANewBoardIsNotAWin() { var game = new Game(); var board = new BoardAPI(Game.NUMBER_OF_COLUMNS, Game.NUMBER_OF_ROWS); board.MakeMove(game.Cells, 1, true); var actualResult = board.WasWinningMove(game.Cells, 1, true); Assert.IsFalse(actualResult); }
public void CheckForWinningVerticalMove() { var game = new Game(); var board = new BoardAPI(Game.NUMBER_OF_COLUMNS, Game.NUMBER_OF_ROWS); board.MakeMove(game.Cells, 2, true); board.MakeMove(game.Cells, 2, true); board.MakeMove(game.Cells, 2, true); board.MakeMove(game.Cells, 2, true); var actualResult = board.WasWinningMove(game.Cells, 2, true); Assert.IsTrue(actualResult); }
public void CheckForWinningDiagonalSWtoNE_Move() { var game = new Game(); var board = new BoardAPI(Game.NUMBER_OF_COLUMNS, Game.NUMBER_OF_ROWS); MakeNonWinningMove(game, 4, RED); MakeNonWinningMove(game, 4, YELLOW); MakeNonWinningMove(game, 4, RED); MakeNonWinningMove(game, 4, YELLOW); MakeNonWinningMove(game, 3, YELLOW); MakeNonWinningMove(game, 3, RED); MakeNonWinningMove(game, 3, YELLOW); MakeNonWinningMove(game, 2, RED); MakeNonWinningMove(game, 2, YELLOW); board.MakeMove(game.Cells, 1, YELLOW); var actualResult = board.WasWinningMove(game.Cells, 1, YELLOW); Assert.IsTrue(actualResult); }