Exemplo n.º 1
0
 public void TakenCardDoesntAppearInDeck()
 {
     var deck = new Deck();
     var takenCard = (Card)deck.TakeCard();
     Assert.IsFalse(deck.Cards.Any(c => c.Suit == takenCard.Suit &&
                                   c.CardNumber == takenCard.CardNumber));
 }
Exemplo n.º 2
0
 public void ResetWorksFromZero()
 {
     var deck = new Deck();
     var cards = deck.TakeCards(52);
     Assert.AreEqual(0, deck.Cards.Count);
     deck.Reset();
     Assert.AreEqual(52, deck.Cards.Count);
 }
Exemplo n.º 3
0
 public void ResetPutsCountBack()
 {
     var deck = new Deck();
     var card = deck.TakeCard();
     Assert.AreEqual(51, deck.Cards.Count);
     deck.Reset();
     Assert.AreEqual(52, deck.Cards.Count);
 }
Exemplo n.º 4
0
 public void CorrectNumberOfCardsPerSuit()
 {
     var deck = new Deck();
     Assert.AreEqual(13, deck.Cards.Count(c => c.Suit == Suit.Club));
     Assert.AreEqual(13, deck.Cards.Count(c => c.Suit == Suit.Diamond));
     Assert.AreEqual(13, deck.Cards.Count(c => c.Suit == Suit.Heart));
     Assert.AreEqual(13, deck.Cards.Count(c => c.Suit == Suit.Spades));
 }
Exemplo n.º 5
0
 public void CorrectNumberOfCards()
 {
     var deck = new Deck();
     Assert.AreEqual(52, deck.Cards.Count);
 }
Exemplo n.º 6
0
 public void CantTakeMoreThan52Cards()
 {
     var deck = new Deck();
     var cards = deck.TakeCards(52);
     Assert.IsNull(deck.TakeCard());
 }