本文整理匯總了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));
}