Ejemplo n.º 1
0
        public void CompareTo_WithLargeHands_ThatAreIdentical_ReturnsZero()
        {
            List <Card> cards = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 13, 12, 11, 9, 8, 6, 5, 4, 2, 1 });
            Flush       hand1 = new Flush(cards);
            Flush       hand2 = new Flush(cards);

            Assert.IsTrue(hand1.CompareTo(hand2) == 0);
        }
Ejemplo n.º 2
0
        public void CompareTo_WithIdenticalFlushHands_ReturnsZero()
        {
            List <Card> cards = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 13, 10, 3, 5, 4 });
            Flush       hand1 = new Flush(cards);
            Flush       hand2 = new Flush(cards);

            Assert.AreEqual(hand1.CompareTo(hand2), 0);
        }
Ejemplo n.º 3
0
        public void CompareTo_ComparingAgainstNonFlushHand_ThrowsException()
        {
            List <Card> cards1    = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 10, 13, 3, 5, 4 });
            Flush       flushHand = new Flush(cards1);
            List <Card> cards2    = TestUtil.CreateDefaultPairCards();
            Pair        pairHand  = new Pair(cards2);

            Assert.ThrowsException <Exception>(() => flushHand.CompareTo(pairHand));
        }
Ejemplo n.º 4
0
        public void CompareTo_WithLargeHands_ThatHaveIdenticalHighestValues_ReturnsZero()
        {
            List <Card> cards1 = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 13, 12, 11, 9, 8, 6, 5, 4, 2, 1 });
            Flush       hand1  = new Flush(cards1);
            List <Card> cards2 = TestUtil.CreateTestFlushCards(Suit.Heart, new int[] { 13, 12, 11, 9, 8, 7, 5, 4, 3, 1 });
            Flush       hand2  = new Flush(cards2);

            Assert.IsTrue(hand1.CompareTo(hand2) == 0);
        }
Ejemplo n.º 5
0
        public void CompareTo_WithEquivalentFlushHands_ReturnsZero()
        {
            List <Card> cards1 = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 13, 10, 3, 5, 4 });
            Flush       hand1  = new Flush(cards1);

            List <Card> cards2 = TestUtil.CreateTestFlushCards(Suit.Heart, new int[] { 4, 3, 5, 10, 13 });
            Flush       hand2  = new Flush(cards2);

            Assert.AreEqual(hand1.CompareTo(hand2), 0);
        }
Ejemplo n.º 6
0
        public void CompareTo_WithDifferentFlushHands_ReturnsNonZero()
        {
            List <Card> cards1 = TestUtil.CreateTestFlushCards(Suit.Club, new int[] { 10, 9, 5, 4, 3 });
            Flush       hand1  = new Flush(cards1);

            List <Card> cards2 = TestUtil.CreateTestFlushCards(Suit.Heart, new int[] { 10, 8, 6, 4, 3 });
            Flush       hand2  = new Flush(cards2);

            Assert.IsTrue(hand1.CompareTo(hand2) > 0);
            Assert.IsTrue(hand2.CompareTo(hand1) < 0);
        }