本文整理汇总了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.");
}
示例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.");
}
示例3: ToStringAceSpades
public void ToStringAceSpades()
{
Card card = new Card(CardFace.Ace, CardSuit.Spades);
var excpected = "A♠";
var actual = card.ToString();
Assert.AreEqual(excpected, actual);
}
示例4: CardToStringShouldReturnACorrectStringValue
public void CardToStringShouldReturnACorrectStringValue()
{
var card = new Card(CardFace.Ace, CardSuit.Spades);
var expected = "Ace of Spades";
Assert.AreEqual(expected, card.ToString());
}
示例5: ShouldReturnTheRightToString
public void ShouldReturnTheRightToString()
{
Card c = new Card("QC");
Check.That(c.ToString()).Equals("QC");
//Assert.AreEqual("QC", c.ToString());
}
示例6: ToStringTwoClubs
public void ToStringTwoClubs()
{
Card card = new Card(CardFace.Two, CardSuit.Clubs);
var excpected = "2♣";
var actual = card.ToString();
Assert.AreEqual(excpected, actual);
}
示例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!");
}
示例8: CardToStringHeartsShouldReturnCorrect
public void CardToStringHeartsShouldReturnCorrect()
{
var card = new Card(CardFace.Jack, CardSuit.Hearts);
var expected = "Jack of Hearts ♥";
Assert.AreEqual(expected, card.ToString());
}
示例9: CardShouldReturnCorrectToString
public void CardShouldReturnCorrectToString()
{
var card = new Card(CardFace.Ace, CardSuit.Clubs);
var expected = "Ace of Clubs";
Assert.AreEqual(expected, card.ToString());
}
示例10: CardToStringShouldBeCorrect
public void CardToStringShouldBeCorrect()
{
Card card = new Card(CardFace.King, CardSuit.Spades);
string expected = "King of Spades";
Assert.AreEqual(expected, card.ToString());
}
示例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];
}
示例12: TestToString
public void TestToString()
{
var cardString = "2H";
var card = new Card(cardString);
Assert.AreEqual(cardString, card.ToString());
}
示例13: TestCardAceSpadesToString
public void TestCardAceSpadesToString()
{
Card card = new Card(CardFace.Ace, CardSuit.Spades);
string expected = "A♠";
string actual = card.ToString();
Assert.AreEqual(expected, actual);
}
示例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());
}
示例15: CardToStringTestFiveOfSpades
public void CardToStringTestFiveOfSpades()
{
Card card = new Card(CardFace.Five, CardSuit.Spades);
string expected = "5♠";
string actual = card.ToString();
Assert.AreEqual(expected, actual);
}