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()));
        }
Exemplo 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);
        }
Exemplo n.º 3
0
        public void TheCardsShouldAllBeUniqueAfterTheShuffle()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();

            packOfCards.Shuffle();

            CollectionAssert.AllItemsAreUnique(packOfCards);
        }
Exemplo 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);
        }