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


C# Card.ToString方法代码示例

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


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

示例1: TestingCardToStringShouldNotReturnEmptyString

 public void TestingCardToStringShouldNotReturnEmptyString()
 {
     var card = new Card(new CardFace(), new CardSuit());
     var test = string.Empty;
     Assert.AreNotEqual(
         test,
         card.ToString(),
         string.Format("Expected {0} to not equal {1}",
         card.ToString(),
         test));
 }
开发者ID:Ivorankov,项目名称:High-Quality-Programing-Code,代码行数:11,代码来源:CardTest.cs

示例2: TestingCardToStringShouldReturnCorrectString_AceSpades

        public void TestingCardToStringShouldReturnCorrectString_AceSpades()
        {
            var card = new Card(CardFace.Ace, CardSuit.Spades);
            var test = "A" + " " + "♠";

            Assert.AreEqual(
                test,
                card.ToString(),
                string.Format("The value {0} does not equal the expected {1}",
                card.ToString(),
                test));
        }
开发者ID:Ivorankov,项目名称:High-Quality-Programing-Code,代码行数:12,代码来源:CardTest.cs

示例3: TestingCardToStringShouldReturnCorrectString_SevenHearts

        public void TestingCardToStringShouldReturnCorrectString_SevenHearts()
        {
            var card = new Card(CardFace.Seven, CardSuit.Hearts);
            var test = "7" + " " + "♥";

            Assert.AreEqual(
                test,
                card.ToString(),
                string.Format("The value {0} does not equal the expected {1}",
                card.ToString(),
                test));
        }
开发者ID:Ivorankov,项目名称:High-Quality-Programing-Code,代码行数:12,代码来源:CardTest.cs

示例4: TestingCardToStringShouldReturnCorrectString_JackDiamond

        public void TestingCardToStringShouldReturnCorrectString_JackDiamond()
        {
            var card = new Card(CardFace.Jack, CardSuit.Diamonds);
            var test = "J" + " " + "♦";

            Assert.AreEqual(
                test,
                card.ToString(),
                string.Format("The value {0} does not equal the expected {1}",
                card.ToString(),
                test));
        }
开发者ID:Ivorankov,项目名称:High-Quality-Programing-Code,代码行数:12,代码来源:CardTest.cs

示例5: TestToStringQueenOfSpades

        public void TestToStringQueenOfSpades()
        {
            Card card = new Card(CardFace.Queen, CardSuit.Spades);
            string result = "Q" + this.spade;

            Assert.AreEqual(card.ToString(), result);
        }
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:TestCard.cs

示例6: TestToStringAceOfClubs

        public void TestToStringAceOfClubs()
        {
            Card card = new Card(CardFace.Ace, CardSuit.Clubs);
            string result = "A" + this.club;

            Assert.AreEqual(card.ToString(), result);
        }
开发者ID:VyaraGGeorgieva,项目名称:TelerikAcademy,代码行数:7,代码来源:TestCard.cs

示例7: Card_ToString_ShouldReturnCorrectFace_Jack

 public void Card_ToString_ShouldReturnCorrectFace_Jack()
 {
     Card card = new Card(CardFace.Jack, CardSuit.Clubs);
     var cardToString = card.ToString();
     var length = cardToString.Length;
     Assert.AreEqual("Jack", cardToString.Substring(0, 4));
 }
开发者ID:VDGone,项目名称:TelerikAcademy-1,代码行数:7,代码来源:CardTests.cs

示例8: CardToStringTestTwoOfSpades

 public void CardToStringTestTwoOfSpades()
 {
     Card card = new Card(CardFace.Two, CardSuit.Spades);
     string expected = "2♠";
     string actual = card.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:kinira,项目名称:DevelopmentTools,代码行数:7,代码来源:CardTests.cs

示例9: CardToStringTestNineOfClubs

 public void CardToStringTestNineOfClubs()
 {
     Card card = new Card(CardFace.Nine, CardSuit.Clubs);
     string expected = "9♣";
     string actual = card.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:kinira,项目名称:DevelopmentTools,代码行数:7,代码来源:CardTests.cs

示例10: PokerTestToStringTwoClubs

        public void PokerTestToStringTwoClubs()
        {
            Card myCard = new Card(CardFace.Two, CardSuit.Clubs);
            string result = myCard.ToString();

            Assert.AreEqual("2♣", result);
        }
开发者ID:ekostadinov,项目名称:CoursesProjects,代码行数:7,代码来源:CardToStringTest.cs

示例11: ToStringJackOfClubs

 public void ToStringJackOfClubs()
 {
     Card card = new Card(CardFace.Jack, CardSuit.Clubs);
     string actual = card.ToString();
     string expected = "J♣";
     Assert.AreEqual(actual, expected);
 }
开发者ID:hristian-dimov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例12: ToStringAceOfSpadesTest

 public void ToStringAceOfSpadesTest()
 {
     Card card = new Card(CardFace.Ace, CardSuit.Spades);
     string actual = card.ToString();
     string expected = "A♠";
     Assert.AreEqual(actual, expected);
 }
开发者ID:hristian-dimov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例13: TestAceHeartToString

 public void TestAceHeartToString()
 {
     Card card = new Card(CardFace.Ace, CardSuit.Hearts);
     string expected = "A♥";
     string result = card.ToString();
     Assert.AreEqual(expected, result);
 }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTests.cs

示例14: TestKingDiamondsToString

 public void TestKingDiamondsToString()
 {
     Card card = new Card(CardFace.King, CardSuit.Spades);
     string expected = "K♠";
     string result = card.ToString();
     Assert.AreEqual(expected, result);
 }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTests.cs

示例15: TestQueenSpadesToString

 public void TestQueenSpadesToString()
 {
     Card card = new Card(CardFace.Queen, CardSuit.Spades);
     string expected = "Q♠";
     string result = card.ToString();
     Assert.AreEqual(expected, result);
 }
开发者ID:bahtev,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTests.cs


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