Esempio n. 1
0
 public GameContext()
 {
     Player = new Player();
     Dealer= new Dealer();
     Deck = new Deck(new SimpleDeckFiller());
     BlackJackGame = new Game(Player, Dealer, Deck);
 }
Esempio n. 2
0
        public void ShouldIndicateBlackJackWhenHaveItInHand()
        {
            var player = new Player();

            player.TakeCard(new Card(CardRank.Ace, CardSuit.Heart));
            player.TakeCard(new Card(CardRank.Queen, CardSuit.Spade));

            Assert.IsTrue(player.HasBlackJack);
        }
Esempio n. 3
0
        public void ShouldBeBustedWhenScoresCountIsMoreThenMax()
        {
            var player = new Player();

            player.TakeCard(new Card(CardRank.King, CardSuit.Heart));
            player.TakeCard(new Card(CardRank.Queen, CardSuit.Spade));
            player.TakeCard(new Card(CardRank.Queen, CardSuit.Club));

            Assert.IsTrue(player.IsBusted);
        }
Esempio n. 4
0
        public void ShouldKeepCardsInHandWhenTakeFromDeck()
        {
            var player = new Player();
            var card1 = new Card(CardRank.Queen,CardSuit.Heart);
            var card2 = new Card(CardRank.Two,CardSuit.Spade);

            player.TakeCard(card1);
            player.TakeCard(card2);

            Assert.AreEqual(2,player.CardsInHand);
        }
Esempio n. 5
0
 public Game(Player player, Dealer dealer, Deck deck)
 {
     _player = player;
     _dealer = dealer;
     _deck = deck;
 }