Example #1
0
        public void WhenPlayer1HasRoyalFlushAndPlayer2HasStraightFlushPlayer1Wins()
        {
            // Given
            const string Cards  = "AC KC QC JC TC 3S 4S 6S 5S 7S";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #2
0
        public void WhenPlayer1HasPairOfKingsHighCardAceAndPlayer2HasPairOfKingsHighCardJackPlayer1Wins()
        {
            // Given
            const string Cards  = "2H 3D AS KC KS 2D 4C JS KH KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #3
0
        public void WhenPlayer1HasStraightFlushAndPlayer2HasFourOfAKindTwosPlayer1Wins()
        {
            // Given
            const string Cards  = "4C 5C 6C 7C 8C 2S 2D 2H 2C KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #4
0
        public void WhenPlayer1HasStraightFlushHighCard8AndPlayer2HasStraightFlushHighCard7Player1Wins()
        {
            // Given
            const string Cards  = "4C 5C 6C 7C 8C 3S 4S 6S 5S 7S";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #5
0
        public void WhenPlayer1HasFullHouseAndPlayer2HasFlushPlayer1Wins()
        {
            // Given
            const string Cards  = "4C 4D 4S JC JH 4H 3H 2H 5H 7H";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #6
0
        public void WhenPlayer1HasFourOfAKindAndPlayer2HasFullHousePlayer1Wins()
        {
            // Given
            const string Cards  = "4C 4D 4S 4H JH 2S 2D 2H KH KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #7
0
        public void WhenPlayer1HasFlushHighCard8AndPlayer2HasFlushHighCard7Player1Wins()
        {
            // Given
            const string Cards  = "4C 3C 8C 5C 6C 4H 3H 2H 5H 7H";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #8
0
        public void WhenPlayer1HasFlushAndPlayer2StraightHighCard6Player1Wins()
        {
            // Given
            const string Cards  = "4C 3C 8C 5C 6C 4H 3D 2S 5D 6S";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #9
0
        public void WhenPlayer1HasHighCardKingAndPlayer2HasHighCardQueenPlayer1Wins()
        {
            // Given
            const string Cards  = "2H 3D 5S KC AS 2D 4C 6S QH AC";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #10
0
        public void WhenPlayer1HasTwoPairKingOverThreeAndPlayer2HasTwoPairKingOverTwoPlayer1Wins()
        {
            // Given
            const string Cards  = "2H 3D 3S KC KS 2D 2C JS KH KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #11
0
        public void ItShouldMarkAPairOfEightsBetterThanAPairOfFives()
        {
            //Given
            string input = "5H 5C 6S 7S KD 2C 3S 8S 8D TD";

            //When
            var scorer = new PokerScorer();
            var result = scorer.Player1Won(input);

            //Then
            Assert.IsFalse(result);
        }
Example #12
0
        public void WhenPlayer1HasThreeAcesAndPlayer2HasTwoPairsPlayer1Wins()
        {
            // Given
            const string Cards  = "AH 3D 2S AC AS 3C 3H 2D KH KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #13
0
        public void ItShouldMarkHigherCardSevenBetterHigherCardTen()
        {
            //Given
            string input = "2C 3S 5S 8D 10D 5H 3C 6S 7S 2D";

            //When
            var scorer = new PokerScorer();
            var result = scorer.Player1Won(input);

            //Then
            Assert.IsTrue(result);
        }
        public void WhenPlayer1HasFullHouseAndPlayer2HasFlushPlayer1Wins()
        {
            // Given
            const string Cards = "4C 4D 4S JC JH 4H 3H 2H 5H 7H";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasFlushHighCard8AndPlayer2HasFlushHighCard7Player1Wins()
        {
            // Given
            const string Cards = "4C 3C 8C 5C 6C 4H 3H 2H 5H 7H";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasFourOfAKindFoursAndPlayer2HasFourOfAKindTwosPlayer1Wins()
        {
            // Given
            const string Cards = "4C 4D 4S 4H JH 2S 2D 2H 2C KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasFlushAndPlayer2StraightHighCard6Player1Wins()
        {
            // Given
            const string Cards = "4C 3C 8C 5C 6C 4H 3D 2S 5D 6S";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
Example #18
0
        public void WhenPlayer1HasStraightAndPlayer2HasThreeKingsPlayer1Wins()
        {
            // Given
            const string Cards  = "4H 3D 2S 5C 6S 3C 4D KC KH KD";
            var          scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasRoyalFlushAndPlayer2HasStraightFlushPlayer1Wins()
        {
            // Given
            const string Cards = "AC KC QC JC TC 3S 4S 6S 5S 7S";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasFullHouseWith3FoursAndPlayer2HasFullHouseWith3TwosPlayer1Wins()
        {
            // Given
            const string Cards = "4C 4D 4S JC JH 2S 2D 2H KH KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasTwoPairKingOverThreeHighCardAceAndPlayer2HasTwoPairKingOverThreeHighCardTwoPlayer1Wins()
        {
            // Given
            const string Cards = "AH 3D 3S KC KS 3C 3H 2S KH KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasTwoPairKingOverThreeAndPlayer2HasTwoPairJackOverFourPlayer1Wins()
        {
            // Given
            const string Cards = "2H 3D 3S KC KS 4D 4C JS JH 2D";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasTwoPairAndPlayer2HasPairPlayer1Wins()
        {
            // Given
            const string Cards = "2H 3D 3S KC KS 2D 4C JS KH KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasThreeAcesAndPlayer2HasTwoPairsPlayer1Wins()
        {
            // Given
            const string Cards = "AH 3D 2S AC AS 3C 3H 2D KH KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasStraightFlushHighCard8AndPlayer2HasStraightFlushHighCard7Player1Wins()
        {
            // Given
            const string Cards = "4C 5C 6C 7C 8C 3S 4S 6S 5S 7S";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasStraightAndPlayer2HasThreeKingsPlayer1Wins()
        {
            // Given
            const string Cards = "4H 3D 2S 5C 6S 3C 4D KC KH KD";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }
        public void WhenPlayer1HasPairOfKingsAndPlayer2HasHighCardAcePlayer1Wins()
        {
            // Given
            const string Cards = "2H 3D 5S KC KS 2D 4C 6S KH AC";
            var scorer = new PokerScorer();

            // When
            bool player1Won = scorer.ScoreGame(Cards);

            // Then
            Assert.IsTrue(player1Won);
        }