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_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); }