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


C# PokerHandsChecker.IsValidHand方法代码示例

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


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

示例1: IsValidHandShouldThrowAnExceptionIfNullListOfCardsIsPassed

        public void IsValidHandShouldThrowAnExceptionIfNullListOfCardsIsPassed()
        {
            List<ICard> cards = null;
            var checker = new PokerHandsChecker();

            checker.IsValidHand(new Hand(cards));
        }
开发者ID:AYankova,项目名称:HQC,代码行数:7,代码来源:PokerHandsCheckerIsValidHandTests.cs

示例2: TestIsValidHand_WithNoCards

 public void TestIsValidHand_WithNoCards()
 {
     Hand currentHand = new Hand(new List<ICard>());
     PokerHandsChecker checker = new PokerHandsChecker();
     bool isValidHand = checker.IsValidHand(currentHand);
     Assert.AreEqual(false, isValidHand);
 }
开发者ID:quela,项目名称:myprojects,代码行数:7,代码来源:TestIsValidHand.cs

示例3: IsValidHandShouldThrowAnExceptionIfNullHandIsPassed

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

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

示例4: isValidHandShouldThrowExceptionWhenHandContainesNotEnoughtCards

 public void isValidHandShouldThrowExceptionWhenHandContainesNotEnoughtCards()
 {
     var handChecker = new PokerHandsChecker();
     var cards = new List<ICard>() { new Card(CardFace.Six, CardSuit.Clubs) };
     var hand = new Hand(cards);
     handChecker.IsValidHand(hand);
 }
开发者ID:antonpopov,项目名称:HighQualityCode,代码行数:7,代码来源:PokerHandsCheckerTest.cs

示例5: IsValidHandShouldThrowAnExceptionWhenTwoEqualCardsArePassed

        public void IsValidHandShouldThrowAnExceptionWhenTwoEqualCardsArePassed()
        {
            var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Three, CardSuit.Clubs), new Card(CardFace.Two, CardSuit.Clubs), new Card(CardFace.Queen, CardSuit.Spades), new Card(CardFace.King, CardSuit.Spades) };
               var hand = new Hand(cards);
               var checker = new PokerHandsChecker();

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

示例6: IsValidHandShouldThrowAnExceptionWhenFiveCardsWithTheSameFaceArePassed

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

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

示例7: IsValidHandShouldThrowAnExceptionIfCountOfTheCardsInTheHandIsNotExactly5

        public void IsValidHandShouldThrowAnExceptionIfCountOfTheCardsInTheHandIsNotExactly5(int count)
        {
            var cards = new List<ICard>() { new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Three, CardSuit.Clubs), new Card(CardFace.Two, CardSuit.Clubs), new Card(CardFace.Queen, CardSuit.Spades), new Card(CardFace.King, CardSuit.Diamonds), new Card(CardFace.King, CardSuit.Spades), new Card(CardFace.Three, CardSuit.Clubs), new Card(CardFace.Two, CardSuit.Clubs), new Card(CardFace.Queen, CardSuit.Spades), new Card(CardFace.King, CardSuit.Diamonds) };
            var hand = new Hand(cards.Take(count).ToList());
            var checker = new PokerHandsChecker();

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

示例8: IsValidHandShouldReturnTrueIfValidHandIsPassed

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

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

示例9: TestOneCardHand

        public void TestOneCardHand()
        {
            List<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Five, CardSuit.Hearts));
            Hand hand = new Hand(cards);
            PokerHandsChecker checker = new PokerHandsChecker();

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

示例10: IsValidHandTestWithZeroCards

        public void IsValidHandTestWithZeroCards()
        {
            PokerHandsChecker checker = new PokerHandsChecker();

            Hand hand = new Hand(new List<ICard>());
            bool expectedValidHand = false;
            bool actual;
            actual = checker.IsValidHand(hand);
            Assert.AreEqual(expectedValidHand, actual);
        }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:10,代码来源:PoketHandsChecker.Tests.cs

示例11: TestNullHand

        public void TestNullHand()
        {
            Hand hand = null;

            PokerHandsChecker checker = new PokerHandsChecker();
            bool expected = false;
            bool actual = checker.IsValidHand(hand);

            Assert.AreEqual(expected, actual);
        }
开发者ID:sabrie,项目名称:TelerikAcademy,代码行数:10,代码来源:PokerHandsCheckerTests.cs

示例12: InvalidCardsCount

        public void InvalidCardsCount()
        {
            PokerHandsChecker checker = new PokerHandsChecker();
            Hand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Jack, CardSuit.Clubs),
                new Card(CardFace.King, CardSuit.Spades),
                new Card(CardFace.Ten, CardSuit.Spades),
                new Card(CardFace.Ace, CardSuit.Diamonds),
            });

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

示例13: IsValidHandShouldThrowIfNotValidHandCardsCountLow

        public void IsValidHandShouldThrowIfNotValidHandCardsCountLow()
        {
            var checker = new PokerHandsChecker();
            var hand = new Hand(new List<ICard>
                {
                    new Card(CardFace.Queen,CardSuit.Hearts),
                    new Card(CardFace.Jack,CardSuit.Hearts),
                    new Card(CardFace.King,CardSuit.Clubs),
                });

            checker.IsValidHand(hand);
        }
开发者ID:zvet80,项目名称:TelerikAcademyHomework,代码行数:12,代码来源:IsValidHandTests.cs

示例14: TestFourCardHand

        public void TestFourCardHand()
        {
            List<ICard> cards = new List<ICard>();
            cards.Add(new Card(CardFace.Five, CardSuit.Hearts));
            cards.Add(new Card(CardFace.Seven, CardSuit.Clubs));
            cards.Add(new Card(CardFace.Jack, CardSuit.Hearts));
            cards.Add(new Card(CardFace.Ace, CardSuit.Diamonds));
            Hand hand = new Hand(cards);
            PokerHandsChecker checker = new PokerHandsChecker();

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

示例15: RepeatedCard

        public void RepeatedCard()
        {
            PokerHandsChecker checker = new PokerHandsChecker();
            Hand hand = new Hand(new List<ICard>() {
                new Card(CardFace.Two, CardSuit.Spades),
                new Card(CardFace.Two, CardSuit.Spades),
                new Card(CardFace.Ten, CardSuit.Spades),
                new Card(CardFace.Ace, CardSuit.Diamonds),
                new Card(CardFace.Queen, CardSuit.Diamonds),
            });

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


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