Welcome to Vegas, Baby!

You lucky dog! You’ve just joined a team of software developers building a new Black Jack simulator! Your first task is design a deck of cards.

Here’s your first cut of the code in C# for a full deck of cards:

tdd/src/Deck.cs
 
public class Deck
 
{
 
private readonly IList<Card> cards = new List<Card>();
 
 
public Deck()
 
{
 
cards.Add(Card.TWO_OF_CLUBS);
 
cards.Add(Card.THREE_OF_CLUBS);
 
// .. remaining clubs
 
 
cards.Add(Card.TWO_OF_DIAMONDS);
 
cards.Add(Card.THREE_OF_DIAMONDS);
 
// ... remaining diamonds
 
 
cards.Add(Card.TWO_OF_SPADES);
 
cards.Add(Card.THREE_OF_SPADES);
 
// ... remaining spades
 
 
cards.Add(Card.TWO_OF_HEARTS);
 
cards.Add(Card.THREE_OF_HEARTS);
 
// ... remaining hearts
 
 
​ ...

Get The Agile Samurai now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.