Esempio n. 1
0
        public void TestDeckCreation()
        {
            Deck d = new Deck();

            Assert.AreEqual(52, d.CardsRemaining);
        }
Esempio n. 2
0
        public void TestDraw()
        {
            Deck d = new Deck();

            Assert.AreEqual(52, d.CardsRemaining);

            Card c = d.Draw();
            Assert.AreEqual(51, d.CardsRemaining);
            Assert.AreEqual(Rank.ACE, c.Rank);
            Assert.AreEqual(Suit.CLUB, c.Suit);

            int count = 51;

            // Draw all cards from the deck
            while ( d.CardsRemaining > 0 )
            {
                c = d.Draw();
                count--;

                Assert.AreEqual(count, d.CardsRemaining);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck = new Deck ();
     _gameTimer = SwinGame.CreateTimer();
 }
Esempio n. 4
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck = new Deck ();
 }
Esempio n. 5
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck = new Deck ();
     _gameTimer = SwinGame.CreateTimer (); //creates gametimer object
 }
Esempio n. 6
0
        public void TestDeckCreation()
        {
            Deck d = new Deck();

            Assert.AreEqual(52, d.CardsRemaining);
        }
Esempio n. 7
0
 /// <summary>
 /// Create a new game of Snap!
 /// </summary>
 public Snap()
 {
     _deck      = new Deck();
     _gameTimer = SwinGame.CreateTimer();
 }