public void NewGameHasInitialPositiveMoney( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Game game) { Assert.True(game.PlayerMoney > 0); Assert.True(game.DealerMoney > 0); }
public void NewGameHasNoCards( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Game game) { Assert.Null(game.PlayersCards); Assert.Null(game.DealersCards); }
public void NewRoundHasNoCards( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Round round) { Assert.Null(round.PlayersCards); Assert.Null(round.DealersCards); }
public void NewRoundIsInCorrectState( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Round round) { Assert.Equal(RoundResults.RoundNotStarted, round.RoundResult); Assert.Equal(RoundStates.RoundIsOver, round.RoundState); }
public void StartRound_SetsCorrectBet( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Game game) { game.StartRound(2); Assert.Equal(2, game.CurrentBet); }
public void NewGameIsInCorrectState( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Game game) { Assert.Equal(RoundResults.RoundNotStarted, game.RoundResult); Assert.Equal(RoundStates.RoundIsOver, game.RoundState); Assert.Equal(GameStates.GameIsInProgress, game.GameState); }
public void StartRound_DealsTwoCardsToEachPlayer( [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, [Frozen(As = typeof(IEndlessCardsProvider))] EndlessCardsProvider cardsProvider, [Frozen(As = typeof(IDealerStrategy))] LeveledDealerStrategy dealerStrategy, Game game) { game.StartRound(2); Assert.Equal(2, game.PlayersCards.Count()); Assert.Equal(2, game.DealersCards.Count()); }
public void Play_ShouldAddCardsUntil17(LeveledDealerStrategy dealerStrategy, Hand dealerHand, [Frozen(As = typeof(IDeckCreator))] FullDeckCreator deckCreator, EndlessCardsProvider cardsProvider) { dealerStrategy.Play(dealerHand, cardsProvider); _outputHelper.WriteLine(string.Join(", ", dealerHand.Cards)); Assert.True(dealerHand.GetValue() >= 17); }