示例#1
0
 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);
 }
示例#2
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);
 }
示例#3
0
 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);
 }
示例#4
0
 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);
 }
示例#5
0
        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);
        }
示例#6
0
 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);
 }
示例#7
0
        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);
        }
        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);
        }