Ejemplo n.º 1
0
        public void SortTest()
        {
            var deck = new DeckCards();
            var c1   = new Card(Card.CardValue.Ten, Card.CardSuit.Heart);
            var c2   = new Card(Card.CardValue.Five, Card.CardSuit.Heart);

            deck.AddCard(c1);
            deck.AddCard(c2);
            deck.Sort();

            // ensure that the values are sorted
            Assert.AreEqual(deck.GetNext(), c2);
            Assert.AreEqual(deck.GetNext(), c1);
        }
Ejemplo n.º 2
0
        public void ValidateEqualDecks()
        {
            var deck1 = new DeckCards(1);
            var deck2 = new DeckCards(1);

            for (int index = 0; index < 52; index++)
            {
                var card1 = deck1.GetNext();
                var card2 = deck2.GetNext();
                Assert.IsTrue(card1 == card2, "decks are not equal");
            }
        }
Ejemplo n.º 3
0
        public void ValidateNonEqualDecks()
        {
            var deck1 = new DeckCards(1);
            var deck2 = new DeckCards(1);

            deck2.Shuffle();

            for (int index = 0; index < 52; index++)
            {
                var card1 = deck1.GetNext();
                var card2 = deck2.GetNext();

                if (card1 != card2)
                {
                    Assert.IsTrue(true);
                    return;
                }
            }
            Assert.IsTrue(false, "Decks are the same");
        }