//From here on its safe just to initialize a new deck since its been proven working. //Toggle deck.Shuffle() to public and remove Shuffle from decks constructor to test this. public static void TestDeckShuffling() { var deck = new Deck(); Console.WriteLine("The unshuffled deck order is:\n" + deck.ToString()); deck.Shuffle(); Console.WriteLine("\nThe shuffled deck order is:\n" + deck.ToString()); Console.ReadKey(); }
public static void TestPlayerFunctionality() { Debug.Assert(testPlayer != null, "Player Error", "Player was not created properly and is null."); var deck = new Deck(); testPlayer.DrawNewHand(deck); Debug.Assert(testPlayer.Hand.Cards.Count() == 5, "Player Error", "Player failed to draw exactly five cards."); Console.WriteLine("The player has been properly instantiated and has drawn 5 cards!"); Console.ReadKey(); }
public void TestDrawingAHand() { var deck = new Deck(); var cardsToDraw = 5; List<Card> drawnCards = deck.DrawCards(cardsToDraw); Assert.AreEqual(cardsToDraw, drawnCards.Count, "Hand Error", "The deck did not draw the expected number of cards."); foreach (var card in drawnCards) Assert.IsInstanceOfType(card, typeof(Card), "Card Error", "The list of drawn cards contained something that wasn't a card."); }
public void DrawNewHand(Deck deck) { Hand = new Hand(deck.DrawCards(5)); }
public void DrawNewHand(Deck deck) { _hand = new Hand(deck.DrawCards(5)); HandType = HandEvaluator.GetHandType(_hand.Cards); }
public static void TestDrawingAHand() { var deck = new Deck(); deck.Shuffle(); //Creating and printing a hand was known to be working at this time. var hand = new Hand(deck.DrawCards(5)); Console.WriteLine("The drawn cards were: " + hand.ToString()); Console.ReadKey(); }