Ejemplo n.º 1
0
        public void When_interpreted_Then_should_be_interpreted_correctly()
        {
            IEnumerable <Card> cards = new List <Card>()
            {
                new Card(CardValue.Two, CardSuit.Heart),
                new Card(CardValue.Two, CardSuit.Spade),
                new Card(CardValue.Two, CardSuit.Diamond),
                new Card(CardValue.Five, CardSuit.Spade),
                new Card(CardValue.Seven, CardSuit.Spade)
            };

            PokerHand pokerHand = PokerHandInterpreter.Interpret(cards);

            Assert.AreEqual(PokerHand.ThreeOfAKind, pokerHand);
        }
Ejemplo n.º 2
0
        public void When_interpreted_Then_should_be_a_straight()
        {
            IEnumerable <Card> cards = new List <Card>()
            {
                new Card(CardValue.Two, CardSuit.Heart),
                new Card(CardValue.Three, CardSuit.Spade),
                new Card(CardValue.Four, CardSuit.Diamond),
                new Card(CardValue.Five, CardSuit.Spade),
                new Card(CardValue.Six, CardSuit.Spade)
            };

            PokerHand pokerHand = PokerHandInterpreter.Interpret(cards);

            Assert.AreEqual(PokerHand.Straight, pokerHand);
        }
Ejemplo n.º 3
0
        public void When_interpreted_Then_should_be_interpreted_correctly()
        {
            IEnumerable <Card> cards = new List <Card>()
            {
                new Card(CardValue.Ace, CardSuit.Spade),
                new Card(CardValue.King, CardSuit.Spade),
                new Card(CardValue.Queen, CardSuit.Spade),
                new Card(CardValue.Jack, CardSuit.Spade),
                new Card(CardValue.Ten, CardSuit.Spade)
            };

            PokerHand pokerHand = PokerHandInterpreter.Interpret(cards);

            Assert.AreEqual(PokerHand.RoyalFlush, pokerHand);
        }