public void IsMatch_OneCard_IsNoMatch()
        {
            List <Card> cards = new List <Card>
            {
                new Card(CardSuit.Spades, CardRank.Ace),
            };

            TwoPairRule rule = new TwoPairRule();

            var isMatch = rule.IsMatch(cards);

            Assert.AreEqual(false, isMatch);
        }
        public void IsMatch_TwoCardsOfSameRank_IsMatch()
        {
            List <Card> cards = new List <Card>
            {
                new Card(CardSuit.Spades, CardRank.Ace),
                new Card(CardSuit.Clubs, CardRank.Ace)
            };

            TwoPairRule rule = new TwoPairRule();

            var isMatch = rule.IsMatch(cards);

            Assert.AreEqual(true, isMatch);
        }
Esempio n. 3
0
        public void ShouldReturnTrueWhenPokerHasTwoPairs(string cardsText, bool expected)
        {
            var cards = cardsText.Split(" ").Select(text => new Card(text)).ToList();

            Assert.Equal(expected, _rule.IsMatch(cards));
        }