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())); }
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); }
public void TheCardsShouldAllBeUniqueAfterTheShuffle() { IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator(); IPackOfCards packOfCards = packOfCardsCreator.Create(); packOfCards.Shuffle(); CollectionAssert.AllItemsAreUnique(packOfCards); }
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); }