本文整理汇总了C#中Santase.Logic.Cards.Deck类的典型用法代码示例。如果您正苦于以下问题:C# Deck类的具体用法?C# Deck怎么用?C# Deck使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Deck类属于Santase.Logic.Cards命名空间,在下文中一共展示了Deck类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayShouldCallGetTurnAndEndTurnForBothPlayers
public void PlayShouldCallGetTurnAndEndTurnForBothPlayers()
{
var firstPlayer = new ValidPlayer();
var firstPlayerInfo = new RoundPlayerInfo(firstPlayer);
var secondPlayer = new ValidPlayer();
var secondPlayerInfo = new RoundPlayerInfo(secondPlayer);
var stateManager = new StateManager();
var deck = new Deck();
SimulateGame(firstPlayerInfo, secondPlayerInfo, deck);
var trick = new Trick(firstPlayerInfo, secondPlayerInfo, stateManager, deck, GameRulesProvider.Santase);
var winner = trick.Play();
Assert.AreEqual(1, firstPlayer.GetTurnCalledCount);
Assert.AreEqual(1, secondPlayer.GetTurnCalledCount);
Assert.AreEqual(1, firstPlayer.EndTurnCalledCount);
Assert.AreEqual(1, secondPlayer.EndTurnCalledCount);
Assert.IsNotNull(firstPlayer.GetTurnContextObject);
Assert.IsNotNull(secondPlayer.GetTurnContextObject);
Assert.IsNotNull(firstPlayer.EndTurnContextObject);
Assert.IsNotNull(secondPlayer.EndTurnContextObject);
Assert.IsNotNull(firstPlayer.EndTurnContextObject.FirstPlayedCard);
Assert.IsNotNull(firstPlayer.EndTurnContextObject.SecondPlayedCard);
Assert.IsNotNull(secondPlayer.EndTurnContextObject.FirstPlayedCard);
Assert.IsNotNull(secondPlayer.EndTurnContextObject.SecondPlayedCard);
Assert.IsTrue(winner == firstPlayerInfo || winner == secondPlayerInfo);
}
示例2: ExpectTrumpCardToEqualSwappedCard
public void ExpectTrumpCardToEqualSwappedCard()
{
var deck = new Deck();
var card = new Card(CardSuit.Club, CardType.Ace);
deck.ChangeTrumpCard(card);
Assert.AreEqual(card, deck.GetTrumpCard);
}
示例3: ChangingTrumpCardShouldNotThrow
public void ChangingTrumpCardShouldNotThrow()
{
Deck deck = new Deck();
Card trumpCard = deck.GetTrumpCard;
Card newCard = new Card(CardSuit.Heart, CardType.Nine);
deck.ChangeTrumpCard(newCard);
}
示例4: ExpectTrumpCardToBeCorrectAfterAChange
public void ExpectTrumpCardToBeCorrectAfterAChange()
{
var deck = new Deck();
var trumpCard = deck.GetNextCard();
deck.ChangeTrumpCard(trumpCard);
Assert.AreSame(deck.GetTrumpCard, trumpCard);
}
示例5: TestsIfCardRemovalWorks
public void TestsIfCardRemovalWorks()
{
Deck testDeck = new Deck();
int initialCardsCount = testDeck.CardsLeft;
testDeck.GetNextCard();
Assert.AreEqual((initialCardsCount - 1), testDeck.CardsLeft, "GetNextCard() should remove 1 card from the deck");
}
示例6: TestDeckChangeTrumpCard
public void TestDeckChangeTrumpCard()
{
var card = new Card(CardSuit.Club, CardType.Jack);
var deck = new Santase.Logic.Cards.Deck();
deck.ChangeTrumpCard(card);
Assert.AreEqual(card, deck.GetTrumpCard);
}
示例7: DeckTestGetNextCardShouldReturnValidCard
public void DeckTestGetNextCardShouldReturnValidCard()
{
var deck = new Deck();
var card = deck.GetNextCard();
Assert.IsTrue(Enum.IsDefined(typeof(CardSuit), card.Suit), "Invalid card suit: " + deck.GetTrumpCard.Suit.ToString());
Assert.IsTrue(Enum.IsDefined(typeof(CardType), card.Type), "Invalid card type: " + deck.GetTrumpCard.Type.ToString());
}
示例8: GetNextCardShouldNotChangeTheTrumpCard
public void GetNextCardShouldNotChangeTheTrumpCard()
{
IDeck deck = new Deck();
var trumpBefore = deck.TrumpCard;
deck.GetNextCard();
var trumpAfter = deck.TrumpCard;
Assert.AreEqual(trumpBefore, trumpAfter);
}
示例9: ChangeTrumpCardShouldWorkProperly
public void ChangeTrumpCardShouldWorkProperly()
{
IDeck deck = new Deck();
var card = new Card(CardSuit.Spade, CardType.Nine);
deck.ChangeTrumpCard(card);
var trumpCard = deck.TrumpCard;
Assert.AreEqual(card, trumpCard);
}
示例10: TestGetNextCardShouldRemoveTheCardFromTheDeck
public void TestGetNextCardShouldRemoveTheCardFromTheDeck()
{
Deck deck = new Deck();
int initialNumberOfCards = deck.CardsLeft;
deck.GetNextCard();
Assert.AreEqual((initialNumberOfCards - 1), deck.CardsLeft, "GetNextCard() should remove 1 card from the deck");
}
示例11: TestChangeWtihDifferentTrumps
public void TestChangeWtihDifferentTrumps(string patternForCard)
{
Deck cards = new Deck();
Card trump = GenerateCard(patternForCard);
cards.ChangeTrumpCard(trump);
Assert.AreEqual(trump.Type.ToFriendlyString() + trump.Suit.ToFriendlyString(), cards.GetTrumpCard.ToString());
}
示例12: GetNextCardThrowsAfterTakeCardFromEmptyDeck
public void GetNextCardThrowsAfterTakeCardFromEmptyDeck(int count)
{
var deck = new Deck();
for (int i = 0; i < count; i++)
{
deck.GetNextCard();
}
}
示例13: DeckShouldThrowAnExceptionWhenDrawingMoreCardsThanInTheDeck
public void DeckShouldThrowAnExceptionWhenDrawingMoreCardsThanInTheDeck()
{
var deck = new Deck();
for (int i = 1; i <= 25; i++)
{
deck.GetNextCard();
}
}
示例14: GetNextCardShouldThrowExceptionIfGetNextCardIsCalledMoreThanTheNumberOfCardsInDeck
public void GetNextCardShouldThrowExceptionIfGetNextCardIsCalledMoreThanTheNumberOfCardsInDeck()
{
var deck = new Deck();
for (int i = 0; i <= CardsCount; i++)
{
deck.GetNextCard();
}
}
示例15: DeckTestGetNextCard25TimesShouldThrow
public void DeckTestGetNextCard25TimesShouldThrow()
{
var deck = new Deck();
for (int i = 0; i < cardsCount + 1; i++)
{
var card = deck.GetNextCard();
}
}