Esempio n. 1
0
        public void TheCardShouldNoLongerBeInThePackAfterACardIsRemoved()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();

            ICard cardRemoved = packOfCards.TakeCardFromTopOfPack();

            CollectionAssert.DoesNotContain(packOfCards, cardRemoved);
        }
Esempio n. 2
0
        public void TheCardsShouldAllBeUniqueAfterTheShuffle()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards        packOfCards        = packOfCardsCreator.Create();

            packOfCards.Shuffle();

            CollectionAssert.AllItemsAreUnique(packOfCards);
        }
Esempio n. 3
0
        public void ThePackOfCardsShouldContain52CardsWhenCreated()
        {
            IPackOfCardsCreator packOfCardsCreator    = new PackOfCardsCreator();
            IPackOfCards        packOfCards           = packOfCardsCreator.Create();
            const int           expectedNumberOfCards = 52;
            int numberOfCards = packOfCards.Count;

            Assert.AreEqual(expectedNumberOfCards, numberOfCards);
        }
Esempio 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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
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);
        }
 public PackOfCardsTests()
 {
     _packOfCards = new PackOfCards(new List <ICard>());
     _reference   = new PackOfCards(new List <ICard>());
 }