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


C# Hand.ToString方法代码示例

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


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

示例1: ToStingShoulReturnStringValue

        public void ToStingShoulReturnStringValue()
        {
            var cards = new List<ICard>() { new Card(CardFace.Ace, CardSuit.Clubs) };
            var hand = new Hand(cards);

            Assert.IsInstanceOfType(hand.ToString(), typeof(string));
        }
开发者ID:TeeeeeC,项目名称:TelerikAcademy2015-2016,代码行数:7,代码来源:HandTests.cs

示例2: HandToStringWithCorrectCards

 public void HandToStringWithCorrectCards()
 {
     IList<ICard> cards = new List<ICard>() { new Card(CardFace.Queen, CardSuit.Hearts), new Card(CardFace.King, CardSuit.Hearts) };
     var hand = new Hand(cards);
     var expected = "Queen of Hearts ♥ / King of Hearts ♥";
     Assert.AreEqual(expected, hand.ToString());
 }
开发者ID:Evgeniy-Ivanov,项目名称:TelerikAcademy,代码行数:7,代码来源:HandTest.cs

示例3: ToString_StringEmptyHand

        [TestMethod]                                                                               // ♣
        public void ToString_StringEmptyHand()                                                     // ♦
        {                                                                                          // ♥
            IHand hand = new Hand(new List<ICard>());                                              // ♠

            string actual = hand.ToString();
            Assert.AreEqual(String.Empty, actual, "Tostring() method of Hand not implemented currenctly.");
        }
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:8,代码来源:HandToStringTest.cs

示例4: HandToStringShouldReturnACorrectStringValue

 public void HandToStringShouldReturnACorrectStringValue()
 {
     IList<ICard> cards = new List<ICard>() { new Card(CardFace.Ace, CardSuit.Spades), new Card(CardFace.Queen, CardSuit.Hearts) };
     var hand = new Hand(cards);
     var expected = "Ace of Spades / Queen of Hearts";
     Assert.AreEqual(expected, hand.ToString());
 }
开发者ID:Vyara,项目名称:Telerik-High-Quality-Code-Homeworks,代码行数:7,代码来源:HandTest.cs

示例5: TestToStringWithoutCards

        public void TestToStringWithoutCards()
        {
            IList<ICard> hand = new List<ICard>();

            Hand currentHand = new Hand(hand);

            Assert.AreEqual(string.Empty, currentHand.ToString());
        }
开发者ID:quela,项目名称:myprojects,代码行数:8,代码来源:TestHandToString.cs

示例6: ToString_HandOfOneCard

        public void ToString_HandOfOneCard()
        {
            ICard jackOfDiamonds = new Card(CardFace.Jack, CardSuit.Diamonds);
            IHand hand = new Hand(new List<ICard>() { jackOfDiamonds });

            string actual = hand.ToString();
            Assert.AreEqual("J♦", actual, "Tostring() method of Hand not implemented currenctly.");
        }
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:8,代码来源:HandToStringTest.cs

示例7: ToStringWithSameCard

        public void ToStringWithSameCard()
        {
            var hand = new Hand(new List<ICard>() { 
                new Card(CardFace.Ace, CardSuit.Spades),
                new Card(CardFace.Ace, CardSuit.Spades)
            });

            Assert.AreEqual("A♠ A♠", hand.ToString());
        }
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:9,代码来源:HandToStringTests.cs

示例8: TestHandEmptyToString

        public void TestHandEmptyToString()
        {
            IList<ICard> cards = new List<ICard>();
            Hand hand = new Hand(cards);

            string expected = string.Empty;
            string actual = hand.ToString();
            Assert.AreEqual(expected, actual);
        }
开发者ID:nkolarov,项目名称:telerik-academy,代码行数:9,代码来源:HandTests.cs

示例9: CreatingAHandWithValidListOfCardsShouldReturnCorrectToString

        public void CreatingAHandWithValidListOfCardsShouldReturnCorrectToString()
        {
            var cardA = new Card(CardFace.King, CardSuit.Spades);
            var cardB = new Card(CardFace.Three, CardSuit.Clubs);
            var cards = new List<ICard>() { cardA, cardB };
            var hand = new Hand(cards);
            var expectedValue = cardA.ToString() + Environment.NewLine + cardB.ToString();

            Assert.AreEqual(expectedValue, hand.ToString());
        }
开发者ID:AYankova,项目名称:HQC,代码行数:10,代码来源:HandsTests.cs

示例10: HandToStringTestOneCard

 public void HandToStringTestOneCard()
 {
     Hand hand = new Hand(new List<ICard>()
     {
         new Card(CardFace.Nine, CardSuit.Hearts)
     });
     string expected = "9♥";
     string actual = hand.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:10,代码来源:Hand.Tests.cs

示例11: TestToStringWithOneCard

        public void TestToStringWithOneCard()
        {
            IList<ICard> hand = new List<ICard>
            {
                new Card(CardFace.Ten, CardSuit.Spades)
            };

            Hand currentHand = new Hand(hand);

            Assert.AreEqual("10♠", currentHand.ToString());
        }
开发者ID:quela,项目名称:myprojects,代码行数:11,代码来源:TestHandToString.cs

示例12: ToStringWithFiveCard

        public void ToStringWithFiveCard()
        {
            var hand = new Hand(new List<ICard>() { 
                new Card(CardFace.Ace, CardSuit.Spades),
                new Card(CardFace.King, CardSuit.Clubs),
                new Card(CardFace.Queen, CardSuit.Hearts),
                new Card(CardFace.Jack, CardSuit.Diamonds),
                new Card(CardFace.Ten, CardSuit.Spades),
            });

            Assert.AreEqual("A♠ K♣ Q♥ J♦ 10♠", hand.ToString());
        }
开发者ID:aleks-todorov,项目名称:HomeWorks,代码行数:12,代码来源:HandToStringTests.cs

示例13: HandToString

        public void HandToString()
        {
            Card testCard = new Card(CardFace.Ace, CardSuit.Clubs);
            Card testCard2 = new Card(CardFace.Eight, CardSuit.Diamonds);
            IList<ICard> cards = new List<ICard>();
            cards.Add(testCard);
            cards.Add(testCard2);

            Hand testHand = new Hand(cards);

            Assert.AreEqual("Ace Clubs & Eight Diamonds", testHand.ToString());
        }
开发者ID:AYankova,项目名称:Telerik-Academy-HW,代码行数:12,代码来源:HandTests.cs

示例14: HandToStringReturnCorrectly

        public void HandToStringReturnCorrectly()
        {
            var cards = new List<ICard>
                {
                    new Card(CardFace.Ace, CardSuit.Clubs),
                    new Card(CardFace.Four, CardSuit.Hearts),
                };

            var hand = new Hand(cards);

            Assert.AreEqual("Ace of Clubs | Four of Hearts", hand.ToString());
        }
开发者ID:NikitoG,项目名称:TelerikAcademyHomeworks,代码行数:12,代码来源:HandTests.cs

示例15: HandToStringTestThreeCards

 public void HandToStringTestThreeCards()
 {
     Hand hand = new Hand(new List<ICard>()
     {
         new Card(CardFace.Two, CardSuit.Hearts),
         new Card(CardFace.Three, CardSuit.Diamonds),
         new Card(CardFace.Four, CardSuit.Spades)
     });
     string expected = "2♥ 3♦ 4♠";
     string actual = hand.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:12,代码来源:Hand.Tests.cs


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