public void TheCardShouldNoLongerBeInThePackAfterACardIsRemoved() { IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator(); IPackOfCards packOfCards = packOfCardsCreator.Create(); ICard cardRemoved = packOfCards.TakeCardFromTopOfPack(); CollectionAssert.DoesNotContain(packOfCards, cardRemoved); }
public void TheCardsShouldAllBeUniqueAfterTheShuffle() { IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator(); IPackOfCards packOfCards = packOfCardsCreator.Create(); packOfCards.Shuffle(); CollectionAssert.AllItemsAreUnique(packOfCards); }
public void ThePackOfCardsShouldContain52CardsWhenCreated() { IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator(); IPackOfCards packOfCards = packOfCardsCreator.Create(); const int expectedNumberOfCards = 52; int numberOfCards = packOfCards.Count; Assert.AreEqual(expectedNumberOfCards, numberOfCards); }
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); }
public void TheCountOfThePackShouldDecreaseByOneAfterACardIsTakenFromTheTop() { IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator(); IPackOfCards packOfCards = packOfCardsCreator.Create(); int countBeforeTheCardIsRemoved = packOfCards.Count; int expectedCountAfterCut = countBeforeTheCardIsRemoved - 1; ICard card = packOfCards.TakeCardFromTopOfPack(); int countResult = packOfCards.Count; Assert.AreEqual(expectedCountAfterCut, countResult); }
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 PackOfCardsTests() { _packOfCards = new PackOfCards(new List <ICard>()); _reference = new PackOfCards(new List <ICard>()); }