void GivenAnFullDeck_Shuffle_ReturnsAShuffledDeck()
        {
            Assert.Equal(52, _packOfCards.Count());

            _packOfCards.Shuffle();

            Assert.Equal(52, _packOfCards.Count());
            Assert.False(_reference.First().Equals(_packOfCards.First()));
            Assert.False(_reference.Last().Equals(_packOfCards.Last()));
        }
Ejemplo n.º 2
0
        public void ShufflingTwiceShouldProduceDifferentCardSequences()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();

            packOfCards.Shuffle();
            IList <ICard> shuffle1Sequence = packOfCards.ToList();

            packOfCards.Shuffle();
            IList <ICard> shuffle2Sequence = packOfCards.ToList();

            Assert.AreNotSame(shuffle1Sequence, shuffle2Sequence);
        }
Ejemplo n.º 3
0
        public void TheCardsShouldAllBeUniqueAfterTheShuffle()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();

            packOfCards.Shuffle();

            CollectionAssert.AllItemsAreUnique(packOfCards);
        }
Ejemplo n.º 4
0
        public void ThePackOfCardsShouldContainTheSameNumberOfCardsWhenShuffled()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();
            int expectedCount = packOfCards.Count;

            packOfCards.Shuffle();

            int resultCount = packOfCards.Count;

            Assert.AreEqual(expectedCount, resultCount);
        }