Esempio n. 1
0
        public void NewDeckIsShuffled()
        {
            var dackManager = new CardGameService(_gameRules);
            var ordered     = new Stack <int>(dackManager.InitializeDeck());
            var shuffled    = dackManager.InitializeDeck().GetShuffledStack();

            Assert.Contains(shuffled, item => item >= 1 && item <= _gameRules.DeckSize / 4);
            Assert.Equal(_gameRules.DeckSize, shuffled.Count());
            Assert.NotEqual(ordered, shuffled);
        }
Esempio n. 2
0
        public void ValidateNewDeck()
        {
            var cardGameService = new CardGameService(_gameRules);
            var allCards        = cardGameService.InitializeDeck();

            Assert.Contains(allCards, item => item >= 1 && item <= _gameRules.DeckSize / 4);
            Assert.Equal(_gameRules.DeckSize, allCards.Count());
        }
Esempio n. 3
0
        public void CheckNewPlayersDeckSizes()
        {
            var cardGameService = new CardGameService(_gameRules);
            var deck            = cardGameService.InitializeDeck().GetShuffledStack();

            cardGameService.InitializePlayerDecks(deck);
            var expected = _gameRules.DeckSize / _gameRules.NumberOfPlayers;

            cardGameService.Players.ForEach(player =>
            {
                Assert.Equal(expected, player.Deck.Count());
            });
        }