private void DealNewDeck() { var pile = CardsPack.GetNew52CardsPack(); pile.Shuffle(); mTable.StockPile = pile; }
public void AShuffledPileIsFullBackface() { var pile = CardsPack.GetNew52CardsPack(); pile.Shuffle(); for (int i = 1; i < 53; i++) { Assert.AreEqual(52, pile.CardsCount); Assert.AreEqual(eCardSide.Back, pile.ReadCard(i).VisibleSide, "After shuffle, all cards should be Backface on top"); } }
public void APileCanBeShuffled() { var pile = CardsPack.GetNew52CardsPack(); pile.Shuffle(); var randomCard = pile.ReadCard(1); Debug.Log("First Card is now a " + randomCard); Assert.AreEqual(52, pile.CardsCount, "A deck shuffle should not change the cards count"); Assert.AreEqual(eCardSide.Back, randomCard.VisibleSide, "After shuffle, the cards should be Backface on top"); }
public void WhatIsA_52CardsDeck() { var pile = CardsPack.GetNew52CardsPack(); var aceOfSpades = pile.ReadCard(1); var sevenOfDiamonds = pile.ReadCard(20); var queenOfHearts = pile.ReadCard(38); var kingOfClubs = pile.ReadCard(52); Assert.AreEqual(52, pile.CardsCount); Assert.AreEqual(eCardValue.Ace, aceOfSpades.Value, "The 1st card should be an Ace of Spades"); Assert.AreEqual(eCardColor.Spades, aceOfSpades.Color, "The 1st card should be an Ace of Spades"); Assert.AreEqual(eCardSide.Front, aceOfSpades.VisibleSide, "The 1st card should be an Ace of Spades"); Assert.AreEqual(eCardValue.Seven, sevenOfDiamonds.Value, "The 20th card should be an Seven of Diamonds"); Assert.AreEqual(eCardColor.Diamonds, sevenOfDiamonds.Color, "The 20th card should be an Seven of Diamonds"); Assert.AreEqual(eCardSide.Front, sevenOfDiamonds.VisibleSide, "The 20th card should be an Seven of Diamonds"); Assert.AreEqual(eCardValue.Queen, queenOfHearts.Value, "The 38th card should be an Queen of Hearts"); Assert.AreEqual(eCardColor.Hearts, queenOfHearts.Color, "The 38th card should be an Queen of Hearts"); Assert.AreEqual(eCardSide.Front, queenOfHearts.VisibleSide, "The 38th card should be an Queen of Hearts"); Assert.AreEqual(eCardValue.King, kingOfClubs.Value, "The 52nd card should be an King of Clubs"); Assert.AreEqual(eCardColor.Clubs, kingOfClubs.Color, "The 52nd card should be an King of Clubs"); Assert.AreEqual(eCardSide.Front, kingOfClubs.VisibleSide, "The 52nd card should be an King of Clubs"); }