public void Deck_ShuffleRandomizesCards() { Deck deck = new Deck(); var beforeShuffle = deck.RemainingCards; deck.Shuffle(); Assert.IsFalse(beforeShuffle.SequenceEqual(deck.RemainingCards)); }
/// <summary> /// Initializes a new instance of the <see cref="SolitaireBoard"/> class. /// </summary> public SolitaireBoard() { _mainDeck = new Deck(); _mainDeck.Shuffle(); _gamePiles = new FixedSizeStack<Card>[7]; for (int i = 0; i < _gamePiles.Length; i++) { var pile = new FixedSizeStack<Card>(i + 1); for (int j = 0; j < i + 1; j++) { pile.Push(_mainDeck.Draw()); } _gamePiles[i] = pile; } _suitPiles = new FixedSizeStack<Card>[4]; for (int i = 0; i < _suitPiles.Length; i++) { _suitPiles[i] = new FixedSizeStack<Card>(13); } }