public void PointsAreCorrect(bool expectedSoftness, int expectedSum, params Card[] cardsInHand) { Hand hand = new Hand(); foreach (Card card in cardsInHand) { hand.AddCardDebug(card); } hand.Points().points.Should().Be(expectedSum); hand.Points().soft.Should().Be(expectedSoftness); }
public static void DealCardToDeaer(this Game game) { PropertyInfo deckInfos = typeof(Game).GetProperty("Deck", BindingFlags.NonPublic | BindingFlags.Instance); Deck deck = deckInfos.GetValue(game) as Deck; Card newCard = deck.Draw(); deckInfos.SetValue(game, deck); PropertyInfo handInfos = typeof(Game).GetProperty("DealersHand", BindingFlags.NonPublic | BindingFlags.Instance); Hand hand = handInfos.GetValue(game) as Hand; hand.AddCardDebug(newCard); handInfos.SetValue(game, hand); }