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