本文整理汇总了C#中Poker.Card.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Card.Equals方法的具体用法?C# Card.Equals怎么用?C# Card.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Poker.Card
的用法示例。
在下文中一共展示了Card.Equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestCardShouldCompareCorrectly_DifferentCards
public void TestCardShouldCompareCorrectly_DifferentCards()
{
var cardA = new Card(CardFace.Jack, CardSuit.Clubs);
var cardB = new Card(CardFace.Ace, CardSuit.Hearts);
Assert.IsFalse(cardA.Equals(cardB));
}
示例2: TestCardShouldCompareCorrectly_EqualCards
public void TestCardShouldCompareCorrectly_EqualCards()
{
var cardA = new Card(CardFace.Jack, CardSuit.Clubs);
var cardB = new Card(CardFace.Jack, CardSuit.Clubs);
Assert.IsTrue(cardA.Equals(cardB));
}
示例3: TestCardEqualWithSameFaceAndSameSuitCards
public void TestCardEqualWithSameFaceAndSameSuitCards()
{
Card firstCard = new Card(CardFace.Four, CardSuit.Clubs);
Card secondCard = new Card(CardFace.Four, CardSuit.Clubs);
Assert.AreEqual(firstCard.Equals(secondCard), true);
}
示例4: TestCardEqualWithSameFaceAndDifferentSuitCards
public void TestCardEqualWithSameFaceAndDifferentSuitCards()
{
Card firstCard = new Card(CardFace.Four, CardSuit.Hearts);
Card secondCard = new Card(CardFace.Four, CardSuit.Clubs);
Assert.AreEqual(firstCard.Equals(secondCard), false);
}
示例5: Main
public static void Main()
{
ICard card = new Card(CardFace.Ace, CardSuit.Clubs);
ICard card2 = new Card(CardFace.Ace, CardSuit.Clubs);
Console.WriteLine(card.Equals(card2));
/*
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));
*/
}
示例6: CardShouldCompareCardsCorrectly_SameCard
public void CardShouldCompareCardsCorrectly_SameCard()
{
var cardA = new Card(CardFace.Ace, CardSuit.Hearts);
var cardB = new Card(CardFace.Ace, CardSuit.Hearts);
Assert.IsFalse(cardA.Equals(cardB));
}
示例7: CardShouldCompareCardsCorrectly_DifferentCards
public void CardShouldCompareCardsCorrectly_DifferentCards()
{
var cardA = new Card(CardFace.Ace, CardSuit.Hearts);
var cardB = new Card(CardFace.Queen, CardSuit.Spades);
Assert.IsFalse(cardA.Equals(cardB));
}