public void GetWinner() { List<Card> cards = new List<Card> { new Card(Rank.Ace, Suit.Spades), new Card(Rank.King, Suit.Spades) }; BlackJack blackJack = new BlackJack(cards); int sumOfCards = blackJack.GetSumOfCards(); Assert.AreEqual(true, blackJack.IsWinner(sumOfCards)); }
public void GetSumOfCards() { List<Card> cards = new List<Card>() { new Card(Rank.Three, Suit.Spades), new Card(Rank.Three, Suit.Spades), new Card(Rank.Ace, Suit.Hearts), new Card(Rank.Ace, Suit.Hearts) }; BlackJack blackJack = new BlackJack(cards); Assert.AreEqual(18, blackJack.GetSumOfCards()); }
public void TestAce() { List<Card> upCards = new List<Card>() { new Card(Rank.Ace, Suit.Spades), new Card(Rank.Four, Suit.Hearts), new Card(Rank.Three, Suit.Clubs), new Card(Rank.Jack, Suit.Spades), new Card(Rank.Two, Suit.Spades) }; BlackJack blackJack = new BlackJack(upCards); Assert.AreEqual(20, blackJack.GetSumOfCards()); }
private void LoadGame() { _deck = new DeckOfCards(); _upCards = new List<Card>(); _blackjack = new BlackJack(_upCards); _deck.Shuffle(); lblDeck.Text = _deck.Count.ToString(); lbUpCards.Items.Clear(); lblSum.Text = "0"; lblHoleCard.Text = "???"; btnStart.Enabled = true; btnHitMe.Enabled = false; }
protected override void StartGame() { base.StartGame(); _upCards = new List<Card>(); _blackjack = new BlackJack(_upCards); lbUpCards.Items.Clear(); lblSumOfCards.Text = "0"; lblHoleCard.Text = "???"; }