public void FlipNextCard() { if (_deck.CardsRemaining > 0) // have cards... { _topCards [0] = _topCards [1]; // move top to card 2 _topCards [1] = _deck.Draw (); // get a new top card _topCards[1].TurnOver(); // reveal card } }
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); } }
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); } }