Пример #1
0
 public void Should_be_able_to_reset_deck()
 {
     var deck = new Deck();
     deck.TakeOneHand();
     deck.Reset();
     deck.NumberOfCards.Should().Be(52);
 }
Пример #2
0
        private static void GiveMeTheBestHand(Deck deck, ICardPrinter cardPrinter)
        {
            BigInteger counter = 0;
            Hand currentHand;

            deck.Reset();
            deck.Shuffle();

            do
            {
                counter++;
                if (deck.NumberOfCards < 5)
                {
                    deck.Reset();
                    deck.Shuffle();
                }
                
                currentHand = deck.TakeOneHand();
                //Console.WriteLine(deck.NumberOfCards);
                if (counter%1000 == 0)
                    Console.WriteLine(counter);
            } while (!CheckIfIsTargetHand(currentHand));

            Console.WriteLine("I needed {0} times", counter);
            cardPrinter.Print(currentHand.ShowCard());
        }
Пример #3
0
 private static void ShowOneHand(Deck deck, ICardPrinter cardPrinter)
 {
     Hand hand = deck.TakeOneHand();
     cardPrinter.Print(hand.ShowCard());
 }
Пример #4
0
 public void A_hand_from_deck_should_contains_5_cards()
 {
     var deck = new Deck();
     var hand = deck.TakeOneHand();
     hand.ShowCard().Should().HaveCount(5);
 }
Пример #5
0
 public void Cards_should_be_removed_from_deck_after_a_hand_is_taken()
 {
     var deck = new Deck();
     deck.TakeOneHand();
     deck.NumberOfCards.Should().Be(47);
 }