當前位置: 首頁>>代碼示例>>C#>>正文


C# Card.Equals方法代碼示例

本文整理匯總了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));
        }
開發者ID:Hri100v,項目名稱:Telerik-Academy,代碼行數:7,代碼來源:CardTest.cs

示例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));
        }
開發者ID:Hri100v,項目名稱:Telerik-Academy,代碼行數:7,代碼來源:CardTest.cs

示例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);
        }
開發者ID:DYanis,項目名稱:Poker5CardDrawCompareHandsEngine,代碼行數:7,代碼來源:CardTests.cs

示例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);
        }
開發者ID:DYanis,項目名稱:Poker5CardDrawCompareHandsEngine,代碼行數:7,代碼來源:CardTests.cs

示例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));
             */
        }
開發者ID:tddold,項目名稱:TelerikAcademyHomework,代碼行數:23,代碼來源:PokerExample.cs

示例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));
 }
開發者ID:antonpopov,項目名稱:HighQualityCode,代碼行數:6,代碼來源:CardTest.cs

示例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));
 }
開發者ID:antonpopov,項目名稱:HighQualityCode,代碼行數:6,代碼來源:CardTest.cs


注:本文中的Poker.Card.Equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。