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


C# Card.ToString方法代码示例

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


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

示例1: ToString_CardIsAceOfHearts

        public void ToString_CardIsAceOfHearts()
        {
            ICard aceOfHearts = new Card(CardFace.Ace, CardSuit.Hearts);

            string actual = aceOfHearts.ToString();
            Assert.AreEqual("A♥", actual, "Tostring() method of Card not implemented currenctly.");
        }
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:7,代码来源:CardToStringTest.cs

示例2: ToString_CardIsTenOfDiamonds

        public void ToString_CardIsTenOfDiamonds()
        {
            ICard tenOfDiamonds = new Card(CardFace.Ten, CardSuit.Diamonds);

            string actual = tenOfDiamonds.ToString();
            Assert.AreEqual("10♦", actual, "Tostring() method of Card not implemented currenctly.");
        }
开发者ID:vaster,项目名称:Telerik.vasko,代码行数:7,代码来源:CardToStringTest.cs

示例3: ToStringAceSpades

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

示例4: CardToStringShouldReturnACorrectStringValue

        public void CardToStringShouldReturnACorrectStringValue()
        {
            var card = new Card(CardFace.Ace, CardSuit.Spades);
            var expected = "Ace of Spades";

            Assert.AreEqual(expected, card.ToString());
        }
开发者ID:Vyara,项目名称:Telerik-High-Quality-Code-Homeworks,代码行数:7,代码来源:CardTest.cs

示例5: ShouldReturnTheRightToString

        public void ShouldReturnTheRightToString()
        {
            Card c = new Card("QC");

            Check.That(c.ToString()).Equals("QC");
            //Assert.AreEqual("QC", c.ToString());
        }
开发者ID:Betclic,项目名称:CodingDojo-Katas,代码行数:7,代码来源:CardTests.cs

示例6: ToStringTwoClubs

 public void ToStringTwoClubs()
 {
     Card card = new Card(CardFace.Two, CardSuit.Clubs);
     var excpected = "2♣";
     var actual = card.ToString();
     Assert.AreEqual(excpected, actual);
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例7: ToStringTest

 public void ToStringTest()
 {
     Card card = new Card(CardFace.Nine, CardSuit.Hearts);
     string cardAsText = card.ToString();
     string expectedText = "Nine of Hearts";
     Assert.IsTrue(cardAsText == expectedText, "Invalid string converting of a card!");
 }
开发者ID:nikolay-radkov,项目名称:Telerik-Academy,代码行数:7,代码来源:CardTests.cs

示例8: CardToStringHeartsShouldReturnCorrect

        public void CardToStringHeartsShouldReturnCorrect()
        {
            var card = new Card(CardFace.Jack, CardSuit.Hearts);
            var expected = "Jack of Hearts ♥";

            Assert.AreEqual(expected, card.ToString());
        }
开发者ID:Evgeniy-Ivanov,项目名称:TelerikAcademy,代码行数:7,代码来源:CardTest.cs

示例9: CardShouldReturnCorrectToString

        public void CardShouldReturnCorrectToString()
        {
            var card = new Card(CardFace.Ace, CardSuit.Clubs);
            var expected = "Ace of Clubs";

            Assert.AreEqual(expected, card.ToString());
        }
开发者ID:zvet80,项目名称:TelerikAcademyHomework,代码行数:7,代码来源:CardTests.cs

示例10: CardToStringShouldBeCorrect

        public void CardToStringShouldBeCorrect()
        {
            Card card = new Card(CardFace.King, CardSuit.Spades);
            string expected = "King of Spades";

            Assert.AreEqual(expected, card.ToString());
        }
开发者ID:TodorVyagov,项目名称:High-Quality-Code,代码行数:7,代码来源:CardTests.cs

示例11: PullCardFromPack

    public LibraryCard PullCardFromPack(ShopControl.Gods god, Card.Rarity rarity)
    {
        List<LibraryCard> tempList = new List<LibraryCard> ();

        List<LibraryCard> allCards = CardLibrary.Lib.Values.ToList<LibraryCard>();

        if(SaveDataControl.UnlockedGods.Contains(god)) {
            // => this goal isn't from the pantheon.
            foreach(LibraryCard LC in allCards) {
                if((LC.God == god && LC.ThisRarity == rarity)) {
                    tempList.Add(LC);
                }
            }
        }
        else {
            // => this goal is from the pantheon and the card reward is random.
            foreach(LibraryCard LC in allCards) {
                if(LC.ThisRarity == Card.Rarity.Silver | LC.ThisRarity == Card.Rarity.Bronze) {
                    tempList.Add(LC);
                }
            }
        }

        if(tempList.Count==0) {
            Debug.Log("templist is 0! picked god is " + god.ToString() + "and the rarity is " + rarity.ToString());
            return null;
        }

        int randomNumber = Random.Range (0, tempList.Count-1);
        Debug.Log("templist index is " + randomNumber);
        return tempList[randomNumber];
    }
开发者ID:kenning,项目名称:popul-vuh,代码行数:32,代码来源:CardLibrary.cs

示例12: TestToString

		public void TestToString()
		{
			var cardString = "2H";
			var card = new Card(cardString);

			Assert.AreEqual(cardString, card.ToString());
		}
开发者ID:droach282,项目名称:kata-pokerhands,代码行数:7,代码来源:CardTests.cs

示例13: TestCardAceSpadesToString

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

示例14: InstantiateCard

        public void InstantiateCard()
        {
            var c = new Card('A', Suit.Diamond);
            Assert.AreEqual("Ad", c.ToString());

            c = new Card('A', 'd');
            Assert.AreEqual("Ad", c.ToString());

            c = new Card('a', 'S');
            Assert.AreEqual("As", c.ToString());

            c = new Card('t', Suit.Heart);
            Assert.AreEqual("Th", c.ToString());

            c = new Card('2', Suit.Spade);
            Assert.AreEqual("2s", c.ToString());

            c = new Card("As");
            Assert.AreEqual("As", c.ToString());

            c = new Card("as");
            Assert.AreEqual("As", c.ToString());

            c = new Card("2H");
            Assert.AreEqual("2h", c.ToString());
        }
开发者ID:Dawme,项目名称:HemHandAnalyzer,代码行数:26,代码来源:Card.cs

示例15: CardToStringTestFiveOfSpades

 public void CardToStringTestFiveOfSpades()
 {
     Card card = new Card(CardFace.Five, CardSuit.Spades);
     string expected = "5♠";
     string actual = card.ToString();
     Assert.AreEqual(expected, actual);
 }
开发者ID:Jarolim,项目名称:AllMyHomeworkForTelerikAcademy,代码行数:7,代码来源:Card.Tests.cs


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