Esempio n. 1
0
        public void ShuffleAndDeal()
        {
            var pack         = PackHelper.BuildPiquetPack();
            var shuffledPack = PackHelper.Shuffle(pack);

            foreach (var player in Players)
            {
                CardsHeldByPlayers[player] = new List <Card>();
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsPlayedByPlayers[player] = new List <Card>();
            }

            foreach (var player in Players)
            {
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
            }

            foreach (var player in Players)
            {
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
                CardsHeldByPlayers[player].Add(shuffledPack.Pop());
            }
        }
Esempio n. 2
0
        public void ShufflePackTest()
        {
            var piquetPack   = PackHelper.BuildPiquetPack();
            var shuffledPack = PackHelper.Shuffle(piquetPack);

            Assert.AreEqual(32, shuffledPack.GetCardsCount());
            Assert.AreNotEqual(piquetPack.ToString(), shuffledPack.ToString());

            var shuffledAgainPack = PackHelper.Shuffle(shuffledPack);

            Assert.AreNotEqual(shuffledPack.ToString(), shuffledAgainPack.ToString());
        }