public void SeventhPlayerCanNotJoinAGame() { RollDiceGame game = Create.Game.With(6.Players()); var player7 = new Player(); Assert.Catch <TooManyPlayersException>(() => player7.Join(game)); }
public void Join_IsInGame() { var player = new Player(); var game = new RollDiceGame(); player.Join(game); Assert.True(player.IsInGame); }
public void JoinTheSameGame_AlreadyInGame_ThrowsInvalidOperationException() { var player = new Player(); var game = new RollDiceGame(); player.Join(game); Assert.Catch <InvalidOperationException>(() => player.Join(game)); }
public void TwoPlayersCanJoinAGame() { var game = new RollDiceGame(); new Player().Join(game); var player = new Player(); player.Join(game); Assert.True(player.IsInGame); }
public void CanBetMoreThanOne_Player_Bet() // 2.4 { var game = new RollDiceGame(); var player = Create.Player().In(game).WithChips(600).WithBets(new int[] { 1, 2, 3, 4, 5, 6 }).Please(); int playerChips = player.availableChips.Amount; game.Play(new Dice()); Assert.AreEqual(6 * 100 + playerChips, player.availableChips.Amount); }
public void CanJoinGame_AfterLeavingPreviousGame() { var player = new Player(); var game = new RollDiceGame(); player.Join(game); player.LeaveGame(); player.Join(game); Assert.True(player.IsInGame); }
public PlayerBuilder InGame(RollDiceGame game) { player.Join(game); return(this); }
public GameBuilder FakeGameWithScore(int score) { _game = new RollDiceGameFake(score); return(this); }