當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。