本文整理汇总了C#中Deck.ChangeTrumpCard方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.ChangeTrumpCard方法的具体用法?C# Deck.ChangeTrumpCard怎么用?C# Deck.ChangeTrumpCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck
的用法示例。
在下文中一共展示了Deck.ChangeTrumpCard方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deck_TrumpCardChange_ShouldChangeTrump
public void Deck_TrumpCardChange_ShouldChangeTrump()
{
var deck = new Deck();
var card = new Card(CardSuit.Club, CardType.Ace);
deck.ChangeTrumpCard(card);
Assert.AreEqual(card, deck.TrumpCard);
}
示例2: TestIfDeckChangesTheTrumpCard
public void TestIfDeckChangesTheTrumpCard()
{
var deck = new Deck();
var initialTrumpCard = deck.GetTrumpCard;
var newCard = deck.GetNextCard();
deck.ChangeTrumpCard(newCard);
Assert.AreNotSame(initialTrumpCard, deck.GetTrumpCard, "The deck does not change trump card");
}
示例3: ChangeTrumpCardShouldChangeTheTrumpCardIfThereAreCardsLeftInTheDeck
public void ChangeTrumpCardShouldChangeTheTrumpCardIfThereAreCardsLeftInTheDeck()
{
Deck testDeck = new Deck();
Card initialTrumpCard = testDeck.GetTrumpCard;
Card newCard = testDeck.GetNextCard();
testDeck.ChangeTrumpCard(newCard);
Assert.AreNotSame(initialTrumpCard, testDeck.GetTrumpCard);
}
示例4: ChangingTrumpCardShouldProperlyWork
public void ChangingTrumpCardShouldProperlyWork()
{
var deck = new Deck();
var trumpCard = new Card(CardSuit.Heart, CardType.Ace);
deck.ChangeTrumpCard(trumpCard);
Assert.AreEqual(deck.GetTrumpCard, trumpCard, string.Format("The trump card is not change properly!"));
}
示例5: ChangeTrumpCardShouldNotChangeTheTrumpCardIfThereAreNoCardsLeftInTheDeck
public void ChangeTrumpCardShouldNotChangeTheTrumpCardIfThereAreNoCardsLeftInTheDeck(int cardsToBeDrawn)
{
Deck testDeck = new Deck();
Card initialTrumpCard = testDeck.GetTrumpCard;
Card newCard = new Card(CardSuit.Spade, CardType.Ace);
for (int i = 0; i < cardsToBeDrawn; i++)
{
if (i == cardsToBeDrawn - 1)
{
newCard = testDeck.GetNextCard();
}
else
{
testDeck.GetNextCard();
}
}
testDeck.ChangeTrumpCard(newCard);
Assert.AreEqual(0, testDeck.CardsLeft, "There should be no cards left in the deck after drawing 24 cards");
Assert.AreSame(initialTrumpCard, testDeck.GetTrumpCard, "ChangeTrumpCard should not change the trump card when there are no cards left in the deck");
}
示例6: ChangeTrumpCardShouldNotChangeTheTrumpCardIfThereAreNoCardsLeftInTheDeck
public void ChangeTrumpCardShouldNotChangeTheTrumpCardIfThereAreNoCardsLeftInTheDeck(int cardsToBeDrawn)
{
Deck testDeck = new Deck();
Card initialTrumpCard = testDeck.GetTrumpCard;
Card newCard = new Card(CardSuit.Spade, CardType.Ace);
for (int i = 0; i < cardsToBeDrawn; i++)
{
if (i == cardsToBeDrawn - 1)
{
newCard = testDeck.GetNextCard();
}
else
{
testDeck.GetNextCard();
}
}
testDeck.ChangeTrumpCard(newCard);
Assert.AreEqual(0, testDeck.CardsLeft);
Assert.AreSame(initialTrumpCard, testDeck.GetTrumpCard);
}