Exemplo n.º 1
0
        public virtual void hasStraightFlushTest()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(4, Card.Suit.CLUB),
                new Card(5, Card.Suit.CLUB),
                new Card(12, Card.Suit.CLUB),
                new Card(8, Card.Suit.CLUB),
                new Card(8, Card.Suit.DIAMOND)
            };
            PlayerHand   hand     = new PlayerHand(new Card(6, Card.Suit.CLUB), new Card(7, Card.Suit.CLUB));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreEqual(CardAnalyzer.HandRank.StraightFlush, analyzer.analyze());
        }
Exemplo n.º 2
0
        public virtual void noRoyalFlush2Test()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(10, Card.Suit.CLUB),
                new Card(11, Card.Suit.CLUB),
                new Card(12, Card.Suit.CLUB),
                new Card(13, Card.Suit.CLUB),
                new Card(8, Card.Suit.DIAMOND)
            };
            PlayerHand   hand     = new PlayerHand(new Card(6, Card.Suit.HEART), new Card(7, Card.Suit.CLUB));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreNotEqual(CardAnalyzer.HandRank.RoyalFlush, analyzer.analyze());
        }
Exemplo n.º 3
0
        //ORIGINAL LINE: @Test public void highStraightAnalyzeTest()
        public virtual void highStraightAnalyzeTest()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(1, Card.Suit.CLUB),
                new Card(3, Card.Suit.CLUB),
                new Card(12, Card.Suit.CLUB),
                new Card(2, Card.Suit.CLUB),
                new Card(11, Card.Suit.DIAMOND)
            };
            PlayerHand   hand     = new PlayerHand(new Card(10, Card.Suit.HEART), new Card(13, Card.Suit.HEART));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreEqual(CardAnalyzer.HandRank.Straight, analyzer.analyze());
        }
Exemplo n.º 4
0
        //ORIGINAL LINE: @Test public void noTwoPairTest()
        public virtual void noTwoPairTest()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(4, Card.Suit.CLUB),
                new Card(5, Card.Suit.CLUB),
                new Card(12, Card.Suit.CLUB),
                new Card(2, Card.Suit.CLUB),
                new Card(8, Card.Suit.DIAMOND)
            };
            PlayerHand   hand     = new PlayerHand(new Card(8, Card.Suit.CLUB), new Card(7, Card.Suit.CLUB));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreNotEqual(CardAnalyzer.HandRank.TwoPair, analyzer.analyze());
        }
Exemplo n.º 5
0
        //ORIGINAL LINE: @Test public void hasThreeOfAKindTest()
        public virtual void hasThreeOfAKindTest()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(4, Card.Suit.CLUB),
                new Card(5, Card.Suit.CLUB),
                new Card(12, Card.Suit.CLUB),
                new Card(8, Card.Suit.CLUB),
                new Card(8, Card.Suit.DIAMOND)
            };
            PlayerHand   hand     = new PlayerHand(new Card(8, Card.Suit.HEART), new Card(10, Card.Suit.SPADE));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreEqual(CardAnalyzer.HandRank.ThreeOfAKind, analyzer.analyze());
        }
Exemplo n.º 6
0
        public virtual void noFullHouseTest()
        {
            Card[] cardsOnTable = new Card[]
            {
                new Card(4, Card.Suit.CLUB),
                new Card(5, Card.Suit.CLUB),
                new Card(4, Card.Suit.HEART),
                new Card(4, Card.Suit.DIAMOND),
                new Card(6, Card.Suit.HEART)
            };
            PlayerHand   hand     = new PlayerHand(new Card(7, Card.Suit.CLUB), new Card(8, Card.Suit.CLUB));
            CardAnalyzer analyzer = new CardAnalyzer();

            analyzer.setCardArray(cardsOnTable);
            analyzer.setHand(hand);
            Assert.AreNotEqual(CardAnalyzer.HandRank.FullHouse, analyzer.analyze());
        }