public void FullHouseFound() { var checker = new FullHouseChecker(); var value = checker.HandValue(_hands[6]); value.Should().Be(6.0507m); }
public void WildFullHouseFound2() { var checker = new FullHouseChecker(); var value = checker.HandValue(_hands[13]); value.Should().Be(6.0703m); }
/// <summary> /// Sets the Chain of responsibility for the combination checkers /// </summary> protected virtual void SetupCheckers() { RoyalStraightFlushChecker royalStraightFlushChecker = new RoyalStraightFlushChecker(); StraightFlushChecker straightFlushChecker = new StraightFlushChecker(); FourOfKindChecker fourOfKindChecker = new FourOfKindChecker(); FullHouseChecker fullHouseChecker = new FullHouseChecker(); FlushChecker flushChecker = new FlushChecker(); StraightChecker straightChecker = new StraightChecker(); ThreeOfKindChecker threeOfKindChecker = new ThreeOfKindChecker(); TwoPairsChecker twoPairsChecker = new TwoPairsChecker(); OnePairChecker onePairChecker = new OnePairChecker(); TopCardChecker topCardChecker = new TopCardChecker(); royalStraightFlushChecker.SetNext(straightFlushChecker); straightFlushChecker.SetNext(fourOfKindChecker); fourOfKindChecker.SetNext(fullHouseChecker); fullHouseChecker.SetNext(flushChecker); flushChecker.SetNext(straightChecker); straightChecker.SetNext(threeOfKindChecker); threeOfKindChecker.SetNext(twoPairsChecker); twoPairsChecker.SetNext(onePairChecker); onePairChecker.SetNext(topCardChecker); _firstChecker = royalStraightFlushChecker; }
public void FullHouseNotFound() { var checker = new FullHouseChecker(); for (var i = 0; i < 9; i++) { if (i != 6 && i != 7) { var value = checker.HandValue(_hands[i]); value.Should().Be(0, _hands[i].Select(c => c.ToString()).Aggregate((a, b) => a + " " + b)); } } }
public void FullHouseNotFound() { var checker = new FullHouseChecker(); for (var i = 0; i < _hands.Count; i++) { if (!new[] { 2, 6, 13, 14, 16 }.Contains(i)) { var value = checker.HandValue(_hands[i]); value.Should().Be(0, _hands[i].Select(c => c.ToString()).Aggregate((a, b) => a + " " + b)); } } }
public static PokerCombinationChecker GetChecker() { var highCard = new HighCardChecker(); var onePair = new OnePairChecker() .SuccessiveHand(highCard); var twoPair = new TwoPairChecker() .SuccessiveHand(onePair); var threeOfAKind = new ThreeOfAKindChecker() .SuccessiveHand(twoPair); var straight = new StraightChecker() .SuccessiveHand(threeOfAKind); var flush = new FlushChecker() .SuccessiveHand(straight); var fullHouse = new FullHouseChecker() .SuccessiveHand(flush); var fourOfAKind = new FourOfAKindChecker() .SuccessiveHand(fullHouse); var straightFlush = new StraightFlushChecker() .SuccessiveHand(fourOfAKind); return(straightFlush); }
static PokerCombinationChecker GetChecker() { var highCard = new HighCardChecker(); var onePair = new OnePairChecker() .SuccessiveHand(highCard); var twoPair = new TwoPairChecker() .SuccessiveHand(onePair); var threeOfAKind = new ThreeOfAKindChecker() .SuccessiveHand(twoPair); var straight = new StraightChecker() .SuccessiveHand(threeOfAKind); var flush = new FlushChecker() .SuccessiveHand(straight); var fullHouse = new FullHouseChecker() .SuccessiveHand(flush); var fourOfAKind = new FourOfAKindChecker() .SuccessiveHand(fullHouse); var straightFlush = new StraightFlushChecker() .SuccessiveHand(fourOfAKind); return straightFlush; }