public void NotFourOfAKind() { // 00000000 0000//0000 0000.0000 1/000.0000 0000.00/11 0000.0000 001/0.0000 0000.0001 long notFourOfAKind = 0x0000008003002001; Assert.False(CardsAnalyzer.IsFourOfAKind(notFourOfAKind)); }
public override bool Parse(PokerHand pokerHand) { var result = false; if (CardsAnalyzer.IsFourOfAKind(pokerHand.ToLong())) { result = true; pokerHand.Strength = Strength; pokerHand.Kickers.Add(new Card(CardsAnalyzer.Kickers[0])); pokerHand.Kickers.Add(new Card(CardsAnalyzer.Kickers[1])); } return(result); }
public void FourOfAKind() { // 00000000 0000//0000 0000.0000 1/000.0000 0000.01/00 0000.0000 001/0.0000 0000.0001 long fourOfAKind = 0x0000008004002001; Assert.True(CardsAnalyzer.IsFourOfAKind(fourOfAKind), "Hand got four of a kind only (all aces), four of a kind expected"); // 00000000 0000//0000 0000.0000 1/000.0000 0000.01/01 0000.0000 001/0.0000 0000.0111 fourOfAKind = 0x0000008005002007; Assert.True(CardsAnalyzer.IsFourOfAKind(fourOfAKind), "Hand got four of a kind among other cards, four of a kind expected"); // 00000000 0000//1000 0000.0000 0/100.0000 0000.00/10 0000.0000 000/1.0000 0000.0000 fourOfAKind = 0x0000008005002007; Assert.True(CardsAnalyzer.IsFourOfAKind(fourOfAKind), "Hand got four of a kind (all kings), four of a kind expected"); }