当前位置: 首页>>代码示例>>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;未经允许,请勿转载。