Inheritance: IDeck
コード例 #1
0
 public void GetNextCardShouldThrowExceptionWhenCalled53Times()
 {
     IDeck deck = new Deck();
     for (var i = 0; i < 53; i++)
     {
         deck.GetNextCard();
     }
 }
コード例 #2
0
 public TwoPlayersHandLogic(IList<InternalPlayer> players, int handNumber, int smallBlind)
 {
     this.handNumber = handNumber;
     this.smallBlind = smallBlind;
     this.players = players;
     this.deck = new Deck();
     this.communityCards = new List<Card>(5);
     this.bettingLogic = new TwoPlayersBettingLogic(this.players, smallBlind);
 }
コード例 #3
0
        public HandLogic(IList<InternalPlayer> players, int roundNumber)
        {
            this.players = players;

            // TODO: This logic is OK for 2 players but should be improved. What happens when one player drops?
            this.firstToPlay = (roundNumber - 1) % this.players.Count;

            this.deck = new Deck();
        }
コード例 #4
0
        public void WhenCalledFromTwoDifferentInstancesGetNextCardShouldReturnDifferentCards()
        {
            IDeck deck1 = new Deck();
            IDeck deck2 = new Deck();

            var cards1 = new List<Card>();
            var cards2 = new List<Card>();

            for (var i = 0; i < 52; i++)
            {
                cards1.Add(deck1.GetNextCard());
                cards2.Add(deck2.GetNextCard());
            }

            CollectionAssert.AreNotEquivalent(cards1, cards2);
        }