コード例 #1
0
 public static IEnumerable <Card> DrawNextCards(this PackOfCards packOfCards, int count)
 {
     for (int i = 0; i < count; i++)
     {
         yield return(packOfCards.DrawNextCard());
     }
 }
コード例 #2
0
        public void Setup()
        {
            var packOfCards = new PackOfCards();

            this.numberOfCardsInOriginalPackOfCards = packOfCards.GetNumberOfAvailableCards();
            this.stock = new Stock(packOfCards);
        }
コード例 #3
0
        public void When_drawing_cards_Cards_should_be_random()
        {
            var drawnCardsFromFirstPack = this.packOfCards.DrawNextCards(3);

            var secondPackOfCards        = new PackOfCards();
            var drawnCardsFromSecondPack = secondPackOfCards.DrawNextCards(3);

            drawnCardsFromFirstPack.Should().NotIntersectWith(drawnCardsFromSecondPack);
        }
コード例 #4
0
        static void Main()
        {
            var packOfCards = new PackOfCards();

            Card randomCard;

            for (int i = 0; i < 53; i++)
            {
                randomCard = packOfCards.DrawNextCard();
                if (randomCard.IsEmptyCard())
                {
                    Console.WriteLine("No cards available");
                }
                else
                {
                    Console.WriteLine(randomCard);
                }
            }

            Console.ReadLine();
        }
コード例 #5
0
 public static IEnumerable <Card> DrawAllCards(this PackOfCards packOfCards)
 {
     return(packOfCards.DrawNextCards(52));
 }
コード例 #6
0
 public void Setup()
 {
     packOfCards = new PackOfCards();
 }
コード例 #7
0
 public BoardBuilder WithPackOfCards()
 {
     this.packOfCards = new PackOfCards();
     return(this);
 }
コード例 #8
0
 public static IPackOfCards Create()
 {
     return(PackOfCards.Create());
 }
コード例 #9
0
 public void Setup()
 {
     deck = (PackOfCards) new PackOfCardsCreator().Create();
 }