public void NoCardsInHandToStringTest()
 {
     IList<ICard> cards = new List<ICard>();
     Hand hand = new Hand(cards);
     var result = hand.ToString();
     Assert.AreEqual(string.Empty, result, "The hand's ToString() method does not operate correctly");
 }
 public void OneCardInHandToStringTest()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ten, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     var result = hand.ToString();
     Assert.AreEqual("10♦", result, "The hand's ToString() method does not operate correctly");
 }
 public void TestIsFlushWithInvalidCards()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     handsChecker.IsFlush(hand);
 }
 public void TestHandIsValidWithLessThanFiveCards()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Seven, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsValidHand(hand), "Not validating the hand correctly");
 }
 public void FiveCardsInHandToStringTest()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Nine, CardSuit.Hearts));
     Hand hand = new Hand(cards);
     var result = hand.ToString();
     Assert.AreEqual("A♣ 2♦ 9♥", result, "The hand's ToString() method does not operate correctly");
 }
 public void TestStraightFlushInvalidHand()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     handsChecker.IsStraightFlush(hand);
 }
 public void TestStraighFlushNullHand()
 {
     Hand hand = new Hand(null);
     handsChecker.IsStraightFlush(hand);
 }
 public void TestStraightHasStraight10_A()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ten, CardSuit.Spades));
     cards.Add(new Card(CardFace.Jack, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Queen, CardSuit.Hearts));
     cards.Add(new Card(CardFace.King, CardSuit.Clubs));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsStraight(hand), "Not validating for straight correctly");
 }
 public void TestStraightHasStraightA_5()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Four, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.Three, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Five, CardSuit.Clubs));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsStraight(hand), "Not validating for straight correctly");
 }
 public void TestStraightFlushHasStraightFlush_1()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Jack, CardSuit.Clubs));
     cards.Add(new Card(CardFace.King, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Queen, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Ten, CardSuit.Clubs));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsStraightFlush(hand), "Not validating for straight flush correctly");
 }
 public void TestFullHouseInvalidHand()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Spades));
     cards.Add(new Card(CardFace.Nine, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Nine, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     handsChecker.IsFullHouse(hand);
 }
 public void TestThreeOfKindNoThreeOfKind()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Nine, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsThreeOfAKind(hand), "Not validating for high card correctly");
 }
 public void TestFourOfAKindHasFourOfKind()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Two, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsFourOfAKind(hand), "Not validating for four of a kind correctly");
 }
 public void TestIsFourOfAKindInvalidHand()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Nine, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Nine, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     handsChecker.IsFourOfAKind(hand);
 }
 public void TestStraightFlushNoStraightFlush_3()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Jack, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsStraightFlush(hand), "Not validating for straight flush correctly");
 }
 public void TestStraightFlushNoStraightFlush_4()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Spades));
     cards.Add(new Card(CardFace.Six, CardSuit.Spades));
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.Three, CardSuit.Spades));
     cards.Add(new Card(CardFace.Five, CardSuit.Spades));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsStraightFlush(hand), "Not validating for straight flush correctly");
 }
 public void TestFullHouseHasFullHouse()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Spades));
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Hearts));
     cards.Add(new Card(CardFace.King, CardSuit.Clubs));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsFullHouse(hand), "Not validating for high card correctly");
 }
 public void TestStraightFlushHasStraightFlush_2()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Four, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Three, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Five, CardSuit.Hearts));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsStraightFlush(hand), "Not validating for straight flush correctly");
 }
 public void TestStraightNoStraight_1()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Spades));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
     cards.Add(new Card(CardFace.Nine, CardSuit.Clubs));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsStraight(hand), "Not validating for straight correctly");
 }
 public void TestIsFlushHasFlush()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Nine, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsTrue(handsChecker.IsFlush(hand), "Not checking for flush correctly");
 }
 public void TestStraightNoStraightHasFlush()
 {
     IList<ICard> cards = new List<ICard>();
     cards.Add(new Card(CardFace.Ten, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Jack, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.Queen, CardSuit.Diamonds));
     cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
     Hand hand = new Hand(cards);
     Assert.IsFalse(handsChecker.IsStraight(hand), "Not validating for straight correctly");
 }