本文整理汇总了C#中Deck.DrawHands方法的典型用法代码示例。如果您正苦于以下问题:C# Deck.DrawHands方法的具体用法?C# Deck.DrawHands怎么用?C# Deck.DrawHands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck
的用法示例。
在下文中一共展示了Deck.DrawHands方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawHands_draws_seven_cards_for_two_players
public void DrawHands_draws_seven_cards_for_two_players()
{
// Arrange.
var sut = new Deck();
// Act.
var hands = sut.DrawHands(2);
// Assert.
Assert.That(hands.All(h => h.Count == 7), Is.True);
}
示例2: DrawHands_draws_five_cards_for_more_than_two_players
public void DrawHands_draws_five_cards_for_more_than_two_players(int numHands)
{
// Arrange.
var sut = new Deck();
// Act.
var hands = sut.DrawHands(numHands);
// Assert.
Assert.That(hands.All(h => h.Count == 5), Is.True);
}
示例3: DrawHands_draws_the_top_cards_from_the_stack
public void DrawHands_draws_the_top_cards_from_the_stack()
{
// Arrange.
var seed = Environment.TickCount;
var sut = new Deck();
var controlDeck = new Deck();
sut.Shuffle(seed);
controlDeck.Shuffle(seed);
// Act.
var hands = sut.DrawHands(2);
var controlHands = hands.Select(hand => hand.Select(card => controlDeck.Draw())).ToList();
// Assert.
for (int i = 0; i < hands.Count; i++)
{
var hand = hands[i];
var controlHand = controlHands[i];
ActualValueDelegate<bool> test = () => hand.SequenceEqual(controlHand);
Assert.That(test, Is.True);
}
}