コード例 #1
0
        public void RoundNextPlayerChangeAccordingToRoundDirectionWithoutPlayer()
        {
            var players = PlayerGenerator(3).ToList();

            players.First().Dealer = true;
            DealingService dsLeft  = new DealingService(true, players);
            DealingService dsRight = new DealingService(false, players);

            Assert.AreNotEqual(dsLeft.NextPlayer().Name, dsRight.NextPlayer().Name);
        }
コード例 #2
0
        public void SendAsideToWinnerMakesPlayerHaveMoreCardThanOthers(int nbPlayers)
        {
            var players = Musketeers(nbPlayers);

            players.First().Dealer = true;
            DealingService ds      = new DealingService(true, players);

            ds.DealsAllCardsFromDeck();
            Player attacker = ds.NextPlayer();

            attacker.Attacker = true;

            ds.SendAsideToPlayerHand(attacker);

            while (ds.GetRoundNumber() == 0)
            {
                Player player = ds.NextPlayer();
                Assert.That(attacker.Hand.Count, Is.GreaterThan(player.Hand.Count));
            }
        }
コード例 #3
0
        public void RoundNumberIsCorrect(int nbPlayers)
        {
            var players = PlayerGenerator(nbPlayers).ToList();

            players.First().Dealer = true;
            DealingService ds      = new DealingService(true, players);

            int n = 0;

            while (n < nbPlayers)
            {
                Assert.That(ds.GetRoundNumber() == n);

                for (int i = 0; i < nbPlayers; i++)
                {
                    ds.NextPlayer();
                }

                n++;
            }
        }