本文整理汇总了C#中PokerHandsChecker.IsFlush方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsFlush方法的具体用法?C# PokerHandsChecker.IsFlush怎么用?C# PokerHandsChecker.IsFlush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PokerHandsChecker
的用法示例。
在下文中一共展示了PokerHandsChecker.IsFlush方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PokerHandCheckerIsFlushReturnsFalseIfItIsNot
public void PokerHandCheckerIsFlushReturnsFalseIfItIsNot()
{
var handWithDiamondInBegining = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.Jack, CardSuit.Spades),
new Card(CardFace.Four, CardSuit.Spades),
new Card(CardFace.Queen, CardSuit.Spades),
new Card(CardFace.Eight, CardSuit.Spades),
});
var handWithDiamondInMiddle = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Spades),
new Card(CardFace.Jack, CardSuit.Spades),
new Card(CardFace.Four, CardSuit.Diamonds),
new Card(CardFace.Queen, CardSuit.Spades),
new Card(CardFace.Eight, CardSuit.Spades),
});
var handWithDiamondInEnd = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Spades),
new Card(CardFace.Jack, CardSuit.Spades),
new Card(CardFace.Four, CardSuit.Spades),
new Card(CardFace.Queen, CardSuit.Spades),
new Card(CardFace.Eight, CardSuit.Diamonds),
});
var pokerHandChecker = new PokerHandsChecker();
Assert.IsFalse(pokerHandChecker.IsFlush(handWithDiamondInBegining));
Assert.IsFalse(pokerHandChecker.IsFlush(handWithDiamondInMiddle));
Assert.IsFalse(pokerHandChecker.IsFlush(handWithDiamondInEnd));
}
示例2: IsFlushShouldThrowAnExceptionWhenAHandWithNullCardsIsPassed
public void IsFlushShouldThrowAnExceptionWhenAHandWithNullCardsIsPassed()
{
List<ICard> cards = null;
var checker = new PokerHandsChecker();
checker.IsFlush(new Hand(cards));
}
示例3: IsFlushShouldThrowAnExceptionWhenAnInvalidHandWithTwoSameCardsIsPassed
public void IsFlushShouldThrowAnExceptionWhenAnInvalidHandWithTwoSameCardsIsPassed()
{
var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.Two, CardSuit.Clubs), new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Ace, CardSuit.Spades) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
checker.IsFlush(hand);
}
示例4: IsFlushShouldReturnTrueWhen5NotStraightSpadesArePassed
public void IsFlushShouldReturnTrueWhen5NotStraightSpadesArePassed()
{
var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Queen, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Two, CardSuit.Spades), new Card(CardFace.Three, CardSuit.Spades) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsFlush(hand));
}
示例5: IsFlushShouldReturnFalseWhen4OfSameSuitArePassed
public void IsFlushShouldReturnFalseWhen4OfSameSuitArePassed()
{
var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Five, CardSuit.Spades), new Card(CardFace.Nine, CardSuit.Spades), new Card(CardFace.Jack, CardSuit.Spades), new Card(CardFace.Two, CardSuit.Clubs) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsFlush(hand));
}
示例6: TestIsFlushEmtyHand
public void TestIsFlushEmtyHand()
{
IList<ICard> cards = new List<ICard>();
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
bool expected = false;
bool actual = checker.IsFlush(hand);
Assert.AreEqual(expected, actual);
}
示例7: TestInvalidHand
public void TestInvalidHand()
{
List<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Eight, CardSuit.Spades));
cards.Add(new Card(CardFace.Three, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Jack, CardSuit.Clubs));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsFlush(hand));
}
示例8: InvalidFlush
public void InvalidFlush()
{
PokerHandsChecker checker = new PokerHandsChecker();
Hand hand = new Hand(new List<ICard>() {
new Card(CardFace.Jack, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Diamonds),
new Card(CardFace.Ten, CardSuit.Diamonds),
new Card(CardFace.Ace, CardSuit.Clubs),
new Card(CardFace.Queen, CardSuit.Diamonds),
});
Assert.AreEqual(false, checker.IsFlush(hand));
}
示例9: PokerHandsIsFlushReturnTrueWhenHaveFiveCardOfTheSameSuit
public void PokerHandsIsFlushReturnTrueWhenHaveFiveCardOfTheSameSuit()
{
IHand hand = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.Jack, CardSuit.Diamonds),
new Card(CardFace.Two, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Diamonds),
new Card(CardFace.Seven, CardSuit.Diamonds)
});
var checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsFlush(hand));
}
示例10: PokerHandsIsFlushReturnFalseWhenCardisOfTheDifferentSuit
public void PokerHandsIsFlushReturnFalseWhenCardisOfTheDifferentSuit()
{
IHand hand = new Hand(new List<ICard>() {
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.Jack, CardSuit.Diamonds),
new Card(CardFace.Two, CardSuit.Hearts),
new Card(CardFace.King, CardSuit.Diamonds),
new Card(CardFace.Seven, CardSuit.Diamonds)
});
var checker = new PokerHandsChecker();
Assert.IsTrue(!checker.IsFlush(hand));
}
示例11: IsFlushTrueTest
public void IsFlushTrueTest()
{
Card card1 = new Card(CardFace.Ace, CardSuit.Clubs);
Card card2 = new Card(CardFace.Queen, CardSuit.Clubs);
Card card3 = new Card(CardFace.Five, CardSuit.Clubs);
Card card4 = new Card(CardFace.Seven, CardSuit.Clubs);
Card card5 = new Card(CardFace.Jack, CardSuit.Clubs);
Hand hand = new Hand(card1, card2, card3, card4, card5);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsFlush(hand));
}
示例12: TestFlush
public void TestFlush()
{
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.IsTrue(checker.IsFlush(hand));
}
示例13: IsFlushFalseTest
public void IsFlushFalseTest()
{
Card card1 = new Card(CardFace.Ace, CardSuit.Clubs);
Card card2 = new Card(CardFace.Queen, CardSuit.Spades);
Card card3 = new Card(CardFace.Five, CardSuit.Spades);
Card card4 = new Card(CardFace.Queen, CardSuit.Spades);
Card card5 = new Card(CardFace.Queen, CardSuit.Hearts);
Hand hand = new Hand(card1, card2, card3, card4, card5);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsFlush(hand));
}
示例14: 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.IsFlush(hand));
}
示例15: FlushSpades
public void FlushSpades()
{
PokerHandsChecker checker = new PokerHandsChecker();
Hand hand = new Hand(new List<ICard>() {
new Card(CardFace.Jack, CardSuit.Spades),
new Card(CardFace.King, CardSuit.Spades),
new Card(CardFace.Ten, CardSuit.Spades),
new Card(CardFace.Ace, CardSuit.Spades),
new Card(CardFace.Queen, CardSuit.Spades),
});
Assert.AreEqual(true, checker.IsFlush(hand));
}