public Game(Action<string> writeLine, string[] players) { _players = new Players(); CreatePlayers(players); _gameEngine = new GameEngine(_players, new GamePrinter(writeLine)); _gamePrinter = new GamePrinter(writeLine); _gamePrinter.PrintoutPlayers(players); }
public void give_a_coin_to_the_current_player() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.GiveCoinToCurrentPlayer(); _mockedPlayer.Received().IncreaseCoinsByOne(); }
public void get_the_current_player_location() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.GetCurrentPlayerLocation(); _mockedPlayer.Received().Location(); }
public void get_current_players_name() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.GetCurrentPlayerName(); _mockedPlayer.Received().Name(); }
public void check_if_the_current_player_is_not_in_the_penalty_box() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.IsCurrentPlayerInPenaltyBox(); _mockedPlayer.Received().IsInPenaltyBox(); }
public void change_the_current_player_location() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.ChangeCurrentPlayerLocation(_newLocation); _mockedPlayer.Received().ChangeLocation(_newLocation); }
public void Init() { _gamePrinter = new GamePrinter(_console.WriteLine); _mockedPlayer = Substitute.For<IPlayer>(); _players = Substitute.For<IPlayers>(); _gameEngine = new GameEngine(_players, _gamePrinter); _playerA = new Player("ana", _defaultLocation, _defaultNumberOfCoins); _playerB = new Player("bob", _defaultLocation, _defaultNumberOfCoins); }
public void penalize_the_current_player() { _players.GetNextPlayer().Returns(_mockedPlayer); _gameEngine = new GameEngine(_players, _gamePrinter); _gameEngine.PenalizeCurrentPlayer(); _mockedPlayer.Received().Penalize(); }