public void TestIsStraight() { HD hand = new HD("JS 9C QS TS KD".Split(' ')); Assert.IsTrue(hand.IsStraight()); Assert.IsTrue(hand.GetRank() == HD.HAND.STRAIGHT); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._K); }
public void TestIsFullHouse() { HD hand = new HD("7C 7H 7S TD TC".Split(' ')); Assert.IsTrue(hand.IsFullHouse()); Assert.IsTrue(hand.GetRank() == HD.HAND.FULLHOUSE); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._7); }
public void TestIsFlush() { HD hand = new HD("JS 9S 4S TS KS".Split(' ')); Assert.IsTrue(hand.IsFlush()); Assert.IsTrue(hand.GetRank() == HD.HAND.FLUSH); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._K); }
public void TestIsFourOfAkind() { HD hand = new HD("TD TH TS TC KC".Split(' ')); Assert.IsTrue(hand.IsFourOfAkind()); Assert.IsTrue(hand.GetRank() == HD.HAND.FOUROFAKIND); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._T);//hand.orderedUniqueValues.ToArray()[0]); }
public void TestIsTwoPairs() { HD hand = new HD("5H 5D KS 7S KD".Split(' ')); Assert.IsTrue(hand.IsTwoPairs()); Assert.IsTrue(hand.GetRank() == HD.HAND.TWOPAIRS); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._K); }
public void TestIsThreeOfAKind() { HD hand = new HD("5S 5C KS 5D QD".Split(' ')); Assert.IsTrue(hand.IsThreeOfAKind()); Assert.IsTrue(hand.GetRank() == HD.HAND.THREEOFAKIND); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._5); }
public void TestIsStraightFlush() { String[] hands = new String[] { "3S 4S 5S 6S 7S", "8C 7C 6C 5C 4C", "JH TH 9H QH KH", "QD JD TD 9D 8D" }; foreach (String refHand in hands) { HD hand = new HD(refHand.Split(' ')); Assert.IsTrue(hand.IsStraightFlush()); Assert.IsTrue(hand.GetRank() == HD.HAND.STRAIGHTFLUSH); Assert.IsTrue(hand.GetHighestCardInRank() == hand.orderedUniqueValues.ToArray()[hand.orderedUniqueValues.Count - 1]); } }
public void TestIsOnePair() { // HD hand = new HD("5H 5C 6S 7S KD".Split(' ')); Assert.IsTrue(hand.IsOnePair()); Assert.IsTrue(hand.GetRank() == HD.HAND.ONEPAIR); Assert.IsTrue(hand.GetHighestCardInRank() == HD.CARD._5); hand = new HD("4D 9H AS TC QH".Split(' ')); Assert.IsFalse(hand.IsOnePair()); Assert.IsFalse(hand.GetRank() == HD.HAND.ONEPAIR); }