当前位置: 首页>>代码示例>>C#>>正文


C# PokerHandsChecker.IsOnePair方法代码示例

本文整理汇总了C#中PokerHandsChecker.IsOnePair方法的典型用法代码示例。如果您正苦于以下问题:C# PokerHandsChecker.IsOnePair方法的具体用法?C# PokerHandsChecker.IsOnePair怎么用?C# PokerHandsChecker.IsOnePair使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PokerHandsChecker的用法示例。


在下文中一共展示了PokerHandsChecker.IsOnePair方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsOnePairShouldReturnFalseIfCardsMakeFullHouse

        public void IsOnePairShouldReturnFalseIfCardsMakeFullHouse()
        {
            var cards = new List<ICard>() { new Card(CardFace.Ten, CardSuit.Clubs), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Diamonds), new Card(CardFace.Four, CardSuit.Hearts), new Card(CardFace.Four, CardSuit.Clubs) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例2: IsOnePairShouldReturnFalseIfCardsMakeStraightFlush

        public void IsOnePairShouldReturnFalseIfCardsMakeStraightFlush()
        {
            var cards = new List<ICard>() { new Card(CardFace.Eight, CardSuit.Clubs), new Card(CardFace.Seven, CardSuit.Clubs), new Card(CardFace.Six, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Four, CardSuit.Clubs) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例3: IsOnePairShouldReturnFalseIfCardsAreTheSameSuit

        public void IsOnePairShouldReturnFalseIfCardsAreTheSameSuit()
        {
            var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Two, CardSuit.Spades), new Card(CardFace.Five, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Seven, CardSuit.Spades) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例4: IsOnePairShouldReturnFalseIfCardsMakeFlush

        public void IsOnePairShouldReturnFalseIfCardsMakeFlush()
        {
            var cards = new List<ICard>() { new Card(CardFace.Ace, CardSuit.Clubs), new Card(CardFace.Queen, CardSuit.Clubs), new Card(CardFace.Ten, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Clubs), new Card(CardFace.Three, CardSuit.Clubs) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例5: TestThreeOfAKind

        public void TestThreeOfAKind()
        {
            List<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Jack, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Jack, CardSuit.Spades));
            cards.Add(new Card(CardFace.Three, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Jack, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Queen, CardSuit.Spades));
            Hand hand = new Hand(cards);
            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:PetarPenev,项目名称:Telerik,代码行数:13,代码来源:TestIsOnePair.cs

示例6: TestTwoPairs

        public void TestTwoPairs()
        {
            List<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Five, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Eight, CardSuit.Spades));
            cards.Add(new Card(CardFace.Eight, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.Jack, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Five, CardSuit.Spades));
            Hand hand = new Hand(cards);
            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:PetarPenev,项目名称:Telerik,代码行数:13,代码来源:TestIsOnePair.cs

示例7: TestInvalidHand

        public void TestInvalidHand()
        {
            List<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.King, CardSuit.Diamonds));
            cards.Add(new Card(CardFace.King, CardSuit.Spades));
            cards.Add(new Card(CardFace.King, CardSuit.Hearts));
            cards.Add(new Card(CardFace.King, CardSuit.Clubs));
            cards.Add(new Card(CardFace.King, CardSuit.Clubs));
            Hand hand = new Hand(cards);
            PokerHandsChecker checker = new PokerHandsChecker();

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:PetarPenev,项目名称:Telerik,代码行数:13,代码来源:TestIsOnePair.cs

示例8: IncorrectPairNothing

        public void IncorrectPairNothing()
        {
            PokerHandsChecker checker = new PokerHandsChecker();
            Hand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Seven, CardSuit.Clubs),
                new Card(CardFace.Two, CardSuit.Clubs),
                new Card(CardFace.Jack, CardSuit.Diamonds),
                new Card(CardFace.King, CardSuit.Spades),
                new Card(CardFace.Eight, CardSuit.Hearts),
            });

            Assert.AreEqual(false, checker.IsOnePair(hand));
        }
开发者ID:Dyno1990,项目名称:TelerikAcademy-1,代码行数:13,代码来源:06.RestOfHandCategories.cs

示例9: IsOnePair_TwoPairs

        public void IsOnePair_TwoPairs()
        {
            var hand = new Hand(new List<ICard>()
            {
                new Card(CardFace.Seven,CardSuit.Diamonds),
                new Card(CardFace.Two,CardSuit.Spades),
                new Card(CardFace.Seven,CardSuit.Hearts),
                new Card(CardFace.Five,CardSuit.Clubs),
                new Card(CardFace.Five,CardSuit.Hearts)
            });

            var pokerChecker = new PokerHandsChecker();

            bool result = pokerChecker.IsOnePair(hand);

            Assert.IsFalse(result);
        }
开发者ID:BobbyBorisov,项目名称:TelerikAcademy,代码行数:17,代码来源:TestIsOnePair.cs

示例10: IsOnePair_ThreeCardsFromSameFace

        public void IsOnePair_ThreeCardsFromSameFace()
        {
            var hand = new Hand(new List<ICard>()
            {
                new Card(CardFace.Seven,CardSuit.Diamonds),
                new Card(CardFace.King,CardSuit.Diamonds),
                new Card(CardFace.Seven,CardSuit.Spades),
                new Card(CardFace.Two,CardSuit.Diamonds),
                new Card(CardFace.Seven,CardSuit.Clubs),
            });

            var pokerChecker = new PokerHandsChecker();

            bool result = pokerChecker.IsOnePair(hand);

            Assert.IsFalse(result);
        }
开发者ID:BobbyBorisov,项目名称:TelerikAcademy,代码行数:17,代码来源:TestIsOnePair.cs

示例11: PairSevens

        public void PairSevens()
        {
            PokerHandsChecker checker = new PokerHandsChecker();
            Hand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Seven, CardSuit.Clubs),
                new Card(CardFace.Three, CardSuit.Hearts),
                new Card(CardFace.Seven, CardSuit.Diamonds),
                new Card(CardFace.Ace, CardSuit.Hearts),
                new Card(CardFace.Eight, CardSuit.Spades),
            });

            Assert.AreEqual(true, checker.IsOnePair(hand));
        }
开发者ID:Dyno1990,项目名称:TelerikAcademy-1,代码行数:13,代码来源:06.RestOfHandCategories.cs

示例12: IsOnePairShouldReturnTrueIfThereAreTwoCardsTheSameFace

        public void IsOnePairShouldReturnTrueIfThereAreTwoCardsTheSameFace()
        {
            var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.Five, CardSuit.Spades), new Card(CardFace.Ten, CardSuit.Spades), new Card(CardFace.Seven, CardSuit.Diamonds) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            Assert.IsTrue(checker.IsOnePair(hand));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例13: IsOnePairShouldReturnFalseWhenNotMatchingHandPassed_ThreeOfAKind

        public void IsOnePairShouldReturnFalseWhenNotMatchingHandPassed_ThreeOfAKind()
        {
            var checker = new PokerHandsChecker();
            var cards = new List<ICard>
            {
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Diamonds),
                new Card(CardFace.Two, CardSuit.Spades),
                new Card(CardFace.Two, CardSuit.Hearts),
                new Card(CardFace.Five, CardSuit.Hearts)
            };
            var hand = new Hand(cards);

            Assert.IsFalse(checker.IsOnePair(hand));
        }
开发者ID:RuzmanovDev,项目名称:TelerikAcademy,代码行数:15,代码来源:PokerHandsChecker_Combinations.cs

示例14: IsOnePairShouldThrowAnExceptionWhenFiveOfAKindArePassed

        public void IsOnePairShouldThrowAnExceptionWhenFiveOfAKindArePassed()
        {
            var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.King, CardSuit.Clubs), new Card(CardFace.King, CardSuit.Hearts), new Card(CardFace.King, CardSuit.Diamonds) };
            var hand = new Hand(cards);
            var checker = new PokerHandsChecker();

            checker.IsOnePair(hand);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:8,代码来源:PokerHandsCheckerIsOnePairTests.cs

示例15: IsOnePairShouldThrowAnExceptionWhenANullHandIsPassed

        public void IsOnePairShouldThrowAnExceptionWhenANullHandIsPassed()
        {
            IHand hand = null;
            var checker = new PokerHandsChecker();

            checker.IsOnePair(hand);
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:PokerHandsCheckerIsOnePairTests.cs


注:本文中的PokerHandsChecker.IsOnePair方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。