Пример #1
0
        public void PokerStarsParser_PlayerWasAllinPreflop_PlayersWinningActionWillBeAddedToFlop()
        {
            string handHistory = Resources.PokerStars_RenniwegIsAllInPreflopAndWins1885;

            var renniweg = _parser
                           .ParseHand(handHistory)
                           .AquiredPokerHand.Players.First(p => p.Name == "renniweg");

            var firstFlopAction = renniweg.Rounds[(int)Streets.Flop].Actions.First();

            firstFlopAction.What.ShouldBeEqualTo(ActionTypes.W);
            firstFlopAction.Ratio.ShouldBeEqualTo(1885);
        }
Пример #2
0
        IConvertedPokerHand GetConvertedHandHistoryFromPreviouslyParsedHandsOrParser(
            KeyValuePair <ulong, string> handHistory, IPokerHandParser parser)
        {
            if (_parsedHands.ContainsKey(handHistory.Key))
            {
                return(_parsedHands[handHistory.Key]);
            }

            IAquiredPokerHand aquiredPokerHand;

            if (parser.ParseHand(handHistory.Value).IsValid)
            {
                aquiredPokerHand = parser.AquiredPokerHand;
            }
            else
            {
                throw new UnableToParseHandHistoryException("Parser: " + parser);
            }

            return(ConvertHandAndAddToParsedHands(aquiredPokerHand));
        }