public void IsGameOver_BothPlayersOutOfCards_ShouldReturnTrue() { InitializeTwoPlayerGame(); _mockPlayerService.Setup(mps => mps.IsPlayerOutOfCards(It.IsAny <Player>())).Returns(true); var result = _warGameController.IsGameOver(); Assert.IsTrue(result); }
public void PlayGame() { Console.WriteLine(WELCOME_MESSAGE); var playerName = GetPlayerName(); var gameMode = GetGameMode(); _warGameController.Initialize(new List <string>() { playerName, COMPUTER_PLAYER_NAME }); while (!_warGameController.IsGameOver()) { Console.WriteLine(_warGameController.GetGameStandings()); WaitForSpaceBarIfNeeded(gameMode); Console.WriteLine(); var roundResult = _warGameController.StartNewRound(); Console.WriteLine(roundResult); while (roundResult.IsWarRequired) { WaitForSpaceBarIfNeeded(gameMode); Console.WriteLine(); roundResult = _warGameController.ContinueRoundWithWar(); Console.WriteLine(roundResult); } } Console.WriteLine(); Console.WriteLine(string.Format(WINNER_MESSAGE_FORMAT, _warGameController.GetGameWinnerName())); Console.WriteLine(); Console.WriteLine(PRESS_Q_TO_QUIT); WaitForKeyPress(ConsoleKey.Q); }