本文整理汇总了C#中PokerHandsChecker.IsStraightFlush方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsStraightFlush方法的具体用法?C# PokerHandsChecker.IsStraightFlush怎么用?C# PokerHandsChecker.IsStraightFlush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PokerHandsChecker
的用法示例。
在下文中一共展示了PokerHandsChecker.IsStraightFlush方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
ICard card = new Card(CardFace.Ace, CardSuit.Clubs);
Console.WriteLine(card);
IHand hand = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Clubs),
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Hearts),
new Card(CardFace.King, CardSuit.Spades),
new Card(CardFace.Seven, CardSuit.Diamonds),
});
Console.WriteLine(hand);
IPokerHandsChecker checker = new PokerHandsChecker();
//Console.WriteLine(checker.IsValidHand(hand));
//Console.WriteLine(checker.IsOnePair(hand));
//Console.WriteLine(checker.IsTwoPair(hand));
// vasil test
IList<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Six, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Three, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
hand = new Hand(cards);
Console.WriteLine(checker.IsStraightFlush(hand));
}
示例2: IsStraightFlushShouldReturnFalseIfCardsMakeFlush
public void IsStraightFlushShouldReturnFalseIfCardsMakeFlush()
{
var cards = new List<ICard>() { new Card(CardFace.Ace, CardSuit.Clubs), new Card(CardFace.Queen, CardSuit.Clubs), new Card(CardFace.Ten, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Three, CardSuit.Clubs) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例3: IsStraightFlushShouldReturnFalseIfCardsMakeOnlyStraight
public void IsStraightFlushShouldReturnFalseIfCardsMakeOnlyStraight()
{
var cards = new List<ICard>() { new Card(CardFace.Eight, CardSuit.Spades), new Card(CardFace.Seven, CardSuit.Spades), new Card(CardFace.Six, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Four, CardSuit.Spades) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例4: IsStraightFlushShouldReturnFalseIfCardsMakeFullHouse
public void IsStraightFlushShouldReturnFalseIfCardsMakeFullHouse()
{
var cards = new List<ICard>() { new Card(CardFace.Ten, CardSuit.Clubs), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Diamonds), new Card(CardFace.Four, CardSuit.Hearts), new Card(CardFace.Four, CardSuit.Clubs) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例5: IsStraightFlushShouldReturnFalseIfCardsAreTheSameSuit
public void IsStraightFlushShouldReturnFalseIfCardsAreTheSameSuit()
{
var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Two, CardSuit.Spades), new Card(CardFace.Five, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Seven, CardSuit.Spades) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例6: TestNormalFlush
public void TestNormalFlush()
{
List<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Eight, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Three, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Jack, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Queen, CardSuit.Diamonds));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例7: TestStraightFlush
public void TestStraightFlush()
{
List<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Five, CardSuit.Spades));
cards.Add(new Card(CardFace.Six, CardSuit.Spades));
cards.Add(new Card(CardFace.Seven, CardSuit.Spades));
cards.Add(new Card(CardFace.Eight, CardSuit.Spades));
cards.Add(new Card(CardFace.Nine, CardSuit.Spades));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsStraightFlush(hand));
}
示例8: IsFlushWithDifferentSuits
public void IsFlushWithDifferentSuits()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Clubs),
new Card(CardFace.Three,CardSuit.Hearts),
new Card(CardFace.Four,CardSuit.Clubs),
new Card(CardFace.Five,CardSuit.Diamonds),
new Card(CardFace.Six,CardSuit.Spades)
});
var handChecker = new PokerHandsChecker();
var isValid = handChecker.IsStraightFlush(hand);
Assert.IsFalse(isValid);
}
示例9: IsStraightFlushShouldReturnTrueIfValidStraightFlush
public void IsStraightFlushShouldReturnTrueIfValidStraightFlush()
{
var checker = new PokerHandsChecker();
var hand = new Hand(new List<ICard>
{
new Card(CardFace.Queen,CardSuit.Hearts),
new Card(CardFace.Jack,CardSuit.Hearts),
new Card(CardFace.King,CardSuit.Hearts),
new Card(CardFace.Ace,CardSuit.Hearts),
new Card(CardFace.Ten,CardSuit.Hearts)
});
Assert.IsTrue(checker.IsStraightFlush(hand));
}
示例10: IsStraightFlushShouldReturnFalseIfNotConsequitiveFace
public void IsStraightFlushShouldReturnFalseIfNotConsequitiveFace()
{
var checker = new PokerHandsChecker();
var hand = new Hand(new List<ICard>
{
new Card(CardFace.Queen,CardSuit.Hearts),
new Card(CardFace.Jack,CardSuit.Hearts),
new Card(CardFace.King,CardSuit.Hearts),
new Card(CardFace.Ace,CardSuit.Hearts),
new Card(CardFace.Two,CardSuit.Hearts)
});
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例11: IsStraightFlushShouldReturnFalseIfDiffSuit
public void IsStraightFlushShouldReturnFalseIfDiffSuit()
{
var checker = new PokerHandsChecker();
var hand = new Hand(new List<ICard>
{
new Card(CardFace.Queen,CardSuit.Hearts),
new Card(CardFace.Jack,CardSuit.Hearts),
new Card(CardFace.King,CardSuit.Clubs),
new Card(CardFace.Ace,CardSuit.Spades),
new Card(CardFace.Ten,CardSuit.Diamonds)
});
Assert.IsFalse(checker.IsStraightFlush(hand));
}
示例12: IsFlushWithInvalidHand
public void IsFlushWithInvalidHand()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Ace,CardSuit.Clubs),
new Card(CardFace.Ten,CardSuit.Hearts),
new Card(CardFace.Ace,CardSuit.Clubs),
new Card(CardFace.Queen,CardSuit.Diamonds),
new Card(CardFace.Ace,CardSuit.Spades)
});
var handChecker = new PokerHandsChecker();
var isValid = handChecker.IsStraightFlush(hand);
Assert.IsFalse(isValid);
}
示例13: IsStraightFlush_ProperStraightFlushNotShuffled
public void IsStraightFlush_ProperStraightFlushNotShuffled()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Diamonds),
new Card(CardFace.Three,CardSuit.Diamonds),
new Card(CardFace.Four,CardSuit.Diamonds),
new Card(CardFace.Five,CardSuit.Diamonds),
new Card(CardFace.Six,CardSuit.Diamonds)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraightFlush(hand);
Assert.IsTrue(result);
}
示例14: IsStraightFlush_ProperSFFromNineToJackShuffled
public void IsStraightFlush_ProperSFFromNineToJackShuffled()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Queen,CardSuit.Spades),
new Card(CardFace.King,CardSuit.Spades),
new Card(CardFace.Jack,CardSuit.Spades),
new Card(CardFace.Nine,CardSuit.Spades),
new Card(CardFace.Ten,CardSuit.Spades)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraightFlush(hand);
Assert.IsTrue(result);
}
示例15: IsStraightFlush_OneCardMissingForStraight
public void IsStraightFlush_OneCardMissingForStraight()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Diamonds),
new Card(CardFace.Three,CardSuit.Diamonds),
new Card(CardFace.Four,CardSuit.Diamonds),
new Card(CardFace.Eight,CardSuit.Diamonds),
new Card(CardFace.Six,CardSuit.Diamonds)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraightFlush(hand);
Assert.IsFalse(result);
}