本文整理汇总了C#中Poker.PokerHandsChecker.IsHighCard方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsHighCard方法的具体用法?C# PokerHandsChecker.IsHighCard怎么用?C# PokerHandsChecker.IsHighCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poker.PokerHandsChecker
的用法示例。
在下文中一共展示了PokerHandsChecker.IsHighCard方法的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.IsStraight(hand));
Console.WriteLine(checker.IsOnePair(hand));
Console.WriteLine(checker.IsTwoPair(hand));
Console.WriteLine(checker.IsStraightFlush(hand));
Console.WriteLine(checker.IsFlush(hand));
Console.WriteLine(checker.IsFourOfAKind(hand));
Console.WriteLine(checker.IsThreeOfAKind(hand));
Console.WriteLine(checker.IsHighCard(hand));
Console.WriteLine(checker.IsFullHouse(hand));
}
示例2: HighCardTrueTest
public void HighCardTrueTest()
{
var card1 = new Card(CardFace.King, CardSuit.Hearts);
var card2 = new Card(CardFace.Five, CardSuit.Spades);
var card3 = new Card(CardFace.Seven, CardSuit.Diamonds);
var card4 = new Card(CardFace.Ten, CardSuit.Clubs);
var card5 = new Card(CardFace.Two, CardSuit.Spades);
var cards = new List<ICard>();
cards.Add(card1);
cards.Add(card2);
cards.Add(card3);
cards.Add(card4);
cards.Add(card5);
// ♣
// ♦
// ♥
// ♠
Hand hand = new Hand(cards);
bool expected = true;
PokerHandsChecker checker = new PokerHandsChecker();
bool actual = checker.IsHighCard(hand);
Assert.AreEqual(expected, actual);
}
示例3: NotHighCardHand
public void NotHighCardHand()
{
var hand = new Hand(new List<ICard>() {
new Card(CardFace.Four, CardSuit.Clubs),
new Card(CardFace.Jack, CardSuit.Diamonds),
new Card(CardFace.Four, CardSuit.Spades),
new Card(CardFace.King, CardSuit.Hearts),
new Card(CardFace.Six, CardSuit.Spades)
});
var checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsHighCard(hand));
}
示例4: TestIsHighCardLessCards
public void TestIsHighCardLessCards()
{
Card cardOne = new Card(CardFace.Two, CardSuit.Diamonds);
Card cardTwo = new Card(CardFace.Four, CardSuit.Hearts);
Card cardThree = new Card(CardFace.Jack, CardSuit.Clubs);
IList<ICard> cards = new List<ICard>();
cards.Add(cardOne);
cards.Add(cardTwo);
cards.Add(cardThree);
Hand hand = new Hand(cards);
PokerHandsChecker poker = new PokerHandsChecker();
bool isHighCard = poker.IsHighCard(hand);
Assert.AreEqual(false, isHighCard, "IsHighCard() method in class PokerHandsChecker is not working correctly.");
}
示例5: IsHighCardTest
public void IsHighCardTest()
{
Hand hand = new Hand(new List<ICard>()
{
new Card(CardFace.Ace, CardSuit.Spades),
new Card(CardFace.Eight, CardSuit.Clubs),
new Card(CardFace.Ten, CardSuit.Diamonds),
new Card(CardFace.Jack, CardSuit.Hearts),
new Card(CardFace.Two, CardSuit.Spades)
});
PokerHandsChecker checker = new PokerHandsChecker();
bool actual = checker.IsHighCard(hand);
bool expected = true;
Assert.AreEqual(expected, actual);
}
示例6: TestHighCard1
public void TestHighCard1()
{
ICard[] cards = new ICard[5]
{
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Hearts),
new Card(CardFace.Two, CardSuit.Hearts),
new Card(CardFace.Eight, CardSuit.Spades),
new Card(CardFace.Nine, CardSuit.Clubs)
};
IHand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsHighCard(hand), "High card is not identified correctly.");
}
示例7: IsHighCard_AceAsHightCard
public void IsHighCard_AceAsHightCard()
{
IList<ICard> cards = new List<ICard>
{
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.Two, CardSuit.Diamonds),
new Card(CardFace.Eight, CardSuit.Clubs),
new Card(CardFace.Six, CardSuit.Hearts),
new Card(CardFace.Queen, CardSuit.Spades),
};
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsTrue(checker.IsHighCard(hand));
}
示例8: IsHighCard_ThreeOfAces
public void IsHighCard_ThreeOfAces()
{
IList<ICard> cards = new List<ICard>
{
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.Ace, CardSuit.Spades),
new Card(CardFace.Ace, CardSuit.Hearts),
new Card(CardFace.Eight, CardSuit.Clubs),
new Card(CardFace.Six, CardSuit.Hearts),
};
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
Assert.IsFalse(checker.IsHighCard(hand));
}
示例9: PairOfAces
public void PairOfAces()
{
IList<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Ace, CardSuit.Hearts));
cards.Add(new Card(CardFace.Nine, CardSuit.Clubs));
cards.Add(new Card(CardFace.Ten, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Five, CardSuit.Clubs));
cards.Add(new Card(CardFace.Ace, CardSuit.Spades));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
bool result = checker.IsHighCard(hand);
bool expected = false;
Assert.AreEqual(expected, result);
}
示例10: HighCardTen
public void HighCardTen()
{
IList<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
cards.Add(new Card(CardFace.Ten, CardSuit.Clubs));
cards.Add(new Card(CardFace.Seven, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Four, CardSuit.Clubs));
cards.Add(new Card(CardFace.Five, CardSuit.Spades));
Hand hand = new Hand(cards);
PokerHandsChecker checker = new PokerHandsChecker();
bool result = checker.IsHighCard(hand);
bool expected = true;
Assert.AreEqual(expected, result);
}
示例11: IsNotHighCardTest
public void IsNotHighCardTest()
{
Card twoOfHearts = new Card(CardFace.Two, CardSuit.Hearts);
Card aceOfSpades = new Card(CardFace.Ace, CardSuit.Spades);
Card fourOfHearts = new Card(CardFace.Four, CardSuit.Hearts);
Card aceOfClubs = new Card(CardFace.Ace, CardSuit.Clubs);
Card tenOfHearts = new Card(CardFace.Ten, CardSuit.Hearts);
List<ICard> cardsInHand = new List<ICard>();
cardsInHand.Add(twoOfHearts);
cardsInHand.Add(aceOfSpades);
cardsInHand.Add(fourOfHearts);
cardsInHand.Add(aceOfClubs);
cardsInHand.Add(tenOfHearts);
IHand hand = new Hand(cardsInHand);
PokerHandsChecker handsChecker = new PokerHandsChecker();
Assert.IsFalse(handsChecker.IsHighCard(hand));
}
示例12: IsHighCardTest
public void IsHighCardTest()
{
Card aceClubs = new Card(CardFace.Ace, CardSuit.Clubs);
Card kingClubs = new Card(CardFace.King, CardSuit.Clubs);
Card twoHearts = new Card(CardFace.Two, CardSuit.Hearts);
Card jackClubs = new Card(CardFace.Jack, CardSuit.Clubs);
Card tenOfClubs = new Card(CardFace.Ten, CardSuit.Clubs);
List<ICard> cardsInHand = new List<ICard>();
cardsInHand.Add(tenOfClubs);
cardsInHand.Add(aceClubs);
cardsInHand.Add(jackClubs);
cardsInHand.Add(kingClubs);
cardsInHand.Add(twoHearts);
IHand hand = new Hand(cardsInHand);
PokerHandsChecker handsChecker = new PokerHandsChecker();
Assert.IsTrue(handsChecker.IsHighCard(hand));
}
示例13: TestIsHighCardShoudReturnTrue
public void TestIsHighCardShoudReturnTrue()
{
var checker = new PokerHandsChecker();
var cards = new List<ICard>
{
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Diamonds),
new Card(CardFace.Two, CardSuit.Spades),
new Card(CardFace.Three, CardSuit.Spades),
new Card(CardFace.Five, CardSuit.Hearts)
};
var hand = new Hand(cards);
Assert.IsTrue(checker.IsHighCard(hand));
}
示例14: TestIsHighCardShoudReturnFalseWhenNotMatchingHandPassed_OnePair
public void TestIsHighCardShoudReturnFalseWhenNotMatchingHandPassed_OnePair()
{
var checker = new PokerHandsChecker();
var cards = new List<ICard>
{
new Card(CardFace.Ace, CardSuit.Diamonds),
new Card(CardFace.King, CardSuit.Diamonds),
new Card(CardFace.Two, CardSuit.Spades),
new Card(CardFace.Two, CardSuit.Diamonds),
new Card(CardFace.Five, CardSuit.Hearts)
};
var hand = new Hand(cards);
Assert.IsFalse(checker.IsHighCard(hand));
}
示例15: IsNotHighCardTest
public void IsNotHighCardTest()
{
PokerHandsChecker target = new PokerHandsChecker();
IList<ICard> cards = new List<ICard>();
cards.Add(new Card(CardFace.Two, CardSuit.Diamonds));
cards.Add(new Card(CardFace.Two, CardSuit.Hearts));
cards.Add(new Card(CardFace.Queen, CardSuit.Hearts));
cards.Add(new Card(CardFace.Seven, CardSuit.Hearts));
cards.Add(new Card(CardFace.Six, CardSuit.Clubs));
IHand hand = new Hand(cards);
bool expected = false;
bool actual;
actual = target.IsHighCard(hand);
Assert.AreEqual(expected, actual);
}