public void Test_HandHighCardHigh() { Deck deck = new Deck(); Card[] testCards = new Card[5]; testCards[0] = new Card("2S"); testCards[1] = new Card("3H"); testCards[2] = new Card("4S"); testCards[3] = new Card("5C"); testCards[4] = new Card("6D"); Hand hand = new Hand(testCards); hand.EvaluateHand(); int expected = 6; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("JS"); testCards[1] = new Card("10C"); testCards[2] = new Card("8D"); testCards[3] = new Card("3H"); testCards[4] = new Card("2S"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 11; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("6S"); testCards[1] = new Card("10H"); testCards[2] = new Card("4D"); testCards[3] = new Card("QC"); testCards[4] = new Card("2D"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 12; Assert.AreEqual(expected, hand.GetHighCard()); }
public void Test_HandHighCardPair() { Deck deck = new Deck(); Card[] testCards = new Card[5]; testCards[0] = new Card("AS"); testCards[1] = new Card("AD"); testCards[2] = new Card("QC"); testCards[3] = new Card("JS"); testCards[4] = new Card("10H"); Hand hand = new Hand(testCards); hand.EvaluateHand(); int expected = 14; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("JS"); testCards[1] = new Card("10C"); testCards[2] = new Card("8D"); testCards[3] = new Card("QH"); testCards[4] = new Card("QS"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 12; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("6S"); testCards[1] = new Card("10H"); testCards[2] = new Card("4D"); testCards[3] = new Card("6C"); testCards[4] = new Card("2D"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 6; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("6S"); testCards[1] = new Card("10H"); testCards[2] = new Card("4D"); testCards[3] = new Card("6C"); testCards[4] = new Card("10D"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 10; Assert.AreEqual(expected, hand.GetHighCard()); testCards[0] = new Card("QS"); testCards[1] = new Card("KH"); testCards[2] = new Card("7D"); testCards[3] = new Card("7C"); testCards[4] = new Card("KD"); hand = new Hand(testCards); hand.EvaluateHand(); expected = 13; Assert.AreEqual(expected, hand.GetHighCard()); }