public void GetWinnerSide_QueensMoved15TimesWithTaking_NoDraw()
        {
            //  Arrange
            var playerCheckersFirstPlayer = new List <CheckerModel> {
                new CheckerModel(0, 0, PieceType.Queen, Side.White)
            };
            var playerCheckersSecondPlayer = new List <CheckerModel> {
                new CheckerModel(7, 1, PieceType.Queen, Side.Black)
            };
            DataProvider dataProvider   = new DataProvider(playerCheckersFirstPlayer, playerCheckersSecondPlayer);
            var          mainPlayer     = new MainPlayer(dataProvider, Side.White);
            var          robotPlayer    = new RobotPlayer(dataProvider, Side.Black);
            var          actionsHistory = new Stack <HistoryMove>(GetHistoryActionsWithTaking(playerCheckersFirstPlayer.Single(), playerCheckersSecondPlayer.Single()));

            //  Act
            mainPlayer.CalculateNeighbors();
            robotPlayer.CalculateNeighbors();
            mainPlayer.CalculateAvailablePaths();
            robotPlayer.CalculateAvailablePaths();
            var  gameStatusChecker = new GameStatusChecker(mainPlayer, robotPlayer, actionsHistory);
            Side winnerSide        = gameStatusChecker.GetWinnerSide();

            //  Assert
            Assert.AreEqual(Side.None, winnerSide);
        }
        public void GetWinnerSide_NoBlackCheckers_WhiteVictory()
        {
            //  Arrange
            var playerCheckers = new List <CheckerModel> {
                new CheckerModel(3, 3, PieceType.Checker, Side.White)
            };
            DataProvider dataProvider      = new DataProvider(playerCheckers, new List <CheckerModel>());
            var          gameStatusChecker = new GameStatusChecker(new MainPlayer(dataProvider, Side.White),
                                                                   new RobotPlayer(dataProvider, Side.Black), new Stack <HistoryMove>());
            //  Act
            Side winnerSide = gameStatusChecker.GetWinnerSide();

            //  Assert
            Assert.AreEqual(Side.White, winnerSide);
        }
        public void GetWinnerSide_PlayersHasNotPlayablePaths_Draw()
        {
            //  Arrange
            var playerCheckersFirstPlayer = new List <CheckerModel> {
                new CheckerModel(1, 1, PieceType.Checker, Side.White)
            };
            var playerCheckersSecondPlayer = new List <CheckerModel> {
                new CheckerModel(7, 7, PieceType.Checker, Side.Black)
            };
            DataProvider dataProvider = new DataProvider(playerCheckersFirstPlayer, playerCheckersSecondPlayer);
            var          mainPlayer   = new MainPlayer(dataProvider, Side.White);
            var          robotPlayer  = new RobotPlayer(dataProvider, Side.Black);

            //  Act
            var  gameStatusChecker = new GameStatusChecker(mainPlayer, robotPlayer, new Stack <HistoryMove>());
            Side winnerSide        = gameStatusChecker.GetWinnerSide();

            //  Assert
            Assert.AreEqual(Side.Draw, winnerSide);
        }
        public void GetWinnerSide_WhitePlayerHasNoAvailableMoves_BlackPlayerVictory()
        {
            //  Arrange
            var playerCheckersFirstPlayer = new List <CheckerModel> {
                new CheckerModel(0, 6, PieceType.Checker, Side.White)
            };
            var playerCheckersSecondPlayer = new List <CheckerModel> {
                new CheckerModel(1, 7, PieceType.Checker, Side.Black)
            };
            DataProvider dataProvider = new DataProvider(playerCheckersFirstPlayer, playerCheckersSecondPlayer);
            var          mainPlayer   = new MainPlayer(dataProvider, Side.White);
            var          robotPlayer  = new RobotPlayer(dataProvider, Side.Black);

            //  Act
            mainPlayer.CalculateNeighbors();
            robotPlayer.CalculateNeighbors();
            mainPlayer.CalculateAvailablePaths();
            robotPlayer.CalculateAvailablePaths();
            var  gameStatusChecker = new GameStatusChecker(mainPlayer, robotPlayer, new Stack <HistoryMove>());
            Side winnerSide        = gameStatusChecker.GetWinnerSide();

            //  Assert
            Assert.AreEqual(Side.Black, winnerSide);
        }