Ejemplo n.º 1
0
        public void Run()
        {
            var deckOfCards = new DeckOfCards();

            deckOfCards.InitDeck();
            var cards = deckOfCards.DealCards(5);

            // Draw main screen
            _mainScreen = new MainScreen(ScreenWidth, ScreenHeight, _gameCredit);
            _mainScreen.Show();

            // Wait for ENTER
            _mainScreen.WaitForChipInput();

            _mainScreen.DealFirstHand(cards);

            _mainScreen.WaitForCardStop(cards);

            // Second hand
            var newCardsToDeal = 5 - cards.Count(p => p.Stop);
            var secondHand     = deckOfCards.DealCards(newCardsToDeal);

            deckOfCards.ReplaceWithNewCards(cards, secondHand);
            _mainScreen.DealSecondHand(cards);


            Console.ReadKey();
        }
Ejemplo n.º 2
0
        public void DealCardsTest()
        {
            // Arrange
            DeckOfCards deckOfCards = GenerateTestDeck();

            // Act
            var cards = deckOfCards.DealCards(3);

            // Assert
            Assert.AreEqual(3, cards.Count, "There should be 3 cards in the dealing.");
            Assert.AreEqual(2, deckOfCards.Count, "There should be 2 cards left in the deck.");
        }