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()); } }
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()); }