本文整理汇总了C#中PokerHandsChecker.IsStraight方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsStraight方法的具体用法?C# PokerHandsChecker.IsStraight怎么用?C# PokerHandsChecker.IsStraight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PokerHandsChecker
的用法示例。
在下文中一共展示了PokerHandsChecker.IsStraight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsStraightShouldReturnFalseIfCardsAreTheSameSuit
public void IsStraightShouldReturnFalseIfCardsAreTheSameSuit()
{
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.IsStraight(hand));
}
示例2: IsStraightShouldReturnFalseIfCardsMakeFullHouse
public void IsStraightShouldReturnFalseIfCardsMakeFullHouse()
{
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.IsStraight(hand));
}
示例3: IsStraightShouldReturnFalseIfCardsMakeStraightFlush
public void IsStraightShouldReturnFalseIfCardsMakeStraightFlush()
{
var cards = new List<ICard>() { new Card(CardFace.Eight, CardSuit.Clubs), new Card(CardFace.Seven, CardSuit.Clubs), new Card(CardFace.Six, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Four, CardSuit.Clubs) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraight(hand));
}
示例4: IsStraightShouldReturnFalseIfCardsMakeOnePair
public void IsStraightShouldReturnFalseIfCardsMakeOnePair()
{
var cards = new List<ICard>() { new Card(CardFace.Ace, CardSuit.Clubs), new Card(CardFace.Ace, CardSuit.Spades), new Card(CardFace.Eight, CardSuit.Spades), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Three, CardSuit.Clubs) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraight(hand));
}
示例5: TestStraightTwoSuits
public void TestStraightTwoSuits()
{
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.Clubs));
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.IsStraight(hand));
}
示例6: TestInvalidHand
public void TestInvalidHand()
{
List<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
cards.Add(new Card(CardFace.King, CardSuit.Spades));
cards.Add(new Card(CardFace.King, CardSuit.Hearts));
cards.Add(new Card(CardFace.King, CardSuit.Clubs));
cards.Add(new Card(CardFace.King, CardSuit.Clubs));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraight(hand));
}
示例7: TestOneShortOfStraight
public void TestOneShortOfStraight()
{
List<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Six, CardSuit.Spades));
cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Eight, CardSuit.Clubs));
cards.Add(new Card(CardFace.Three, CardSuit.Spades));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsStraight(hand));
}
示例8: IsStraight_FromSevenToJackShuffled
public void IsStraight_FromSevenToJackShuffled()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Queen,CardSuit.Diamonds),
new Card(CardFace.King,CardSuit.Spades),
new Card(CardFace.Jack,CardSuit.Hearts),
new Card(CardFace.Nine,CardSuit.Clubs),
new Card(CardFace.Ten,CardSuit.Hearts)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraight(hand);
Assert.IsTrue(result);
}
示例9: IsStraight_ProperStraightNotShuffled
public void IsStraight_ProperStraightNotShuffled()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Diamonds),
new Card(CardFace.Three,CardSuit.Spades),
new Card(CardFace.Four,CardSuit.Hearts),
new Card(CardFace.Five,CardSuit.Clubs),
new Card(CardFace.Six,CardSuit.Hearts)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraight(hand);
Assert.IsTrue(result);
}
示例10: IsStraight_OneCardMissingForStraight
public void IsStraight_OneCardMissingForStraight()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Diamonds),
new Card(CardFace.Three,CardSuit.Spades),
new Card(CardFace.Four,CardSuit.Hearts),
new Card(CardFace.Eight,CardSuit.Clubs),
new Card(CardFace.Six,CardSuit.Hearts)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraight(hand);
Assert.IsFalse(result);
}
示例11: IsStraight_FiveDifferentCards
public void IsStraight_FiveDifferentCards()
{
var hand = new Hand(new List<ICard>()
{
new Card(CardFace.Two,CardSuit.Diamonds),
new Card(CardFace.Ace,CardSuit.Spades),
new Card(CardFace.Jack,CardSuit.Hearts),
new Card(CardFace.Five,CardSuit.Clubs),
new Card(CardFace.Ten,CardSuit.Hearts)
});
var pokerChecker = new PokerHandsChecker();
bool result = pokerChecker.IsStraight(hand);
Assert.IsFalse(result);
}
示例12: Straight8ToQ
public void Straight8ToQ()
{
PokerHandsChecker checker = new PokerHandsChecker();
Hand hand = new Hand(new List<ICard>() {
new Card(CardFace.Ten, CardSuit.Diamonds),
new Card(CardFace.Eight, CardSuit.Clubs),
new Card(CardFace.Jack, CardSuit.Diamonds),
new Card(CardFace.Nine, CardSuit.Clubs),
new Card(CardFace.Queen, CardSuit.Spades),
});
Assert.AreEqual(true, checker.IsStraight(hand));
}
示例13: IsStraightShouldThrowAnExceptionWhenFiveOfAKindArePassed
public void IsStraightShouldThrowAnExceptionWhenFiveOfAKindArePassed()
{
var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.King, CardSuit.Hearts), new Card(CardFace.King, CardSuit.Diamonds) };
var hand = new Hand(cards);
var checker = new PokerHandsChecker();
checker.IsStraight(hand);
}
示例14: IsStraightShouldThrowAnExceptionWhenANullHandIsPassed
public void IsStraightShouldThrowAnExceptionWhenANullHandIsPassed()
{
IHand hand = null;
var checker = new PokerHandsChecker();
checker.IsStraight(hand);
}
示例15: IsStraightShouldThrowAnExceptionWhenAnInvalidHandWithTwoSameCardsIsPassed
public void IsStraightShouldThrowAnExceptionWhenAnInvalidHandWithTwoSameCardsIsPassed()
{
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.IsStraight(hand);
}