Beispiel #1
0
        public void ThePackOfCardsShouldContain52CardsWhenCreated()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards packOfCards = packOfCardsCreator.Create();
            const int expectedNumberOfCards = 52;
            int numberOfCards = packOfCards.Count;

            Assert.AreEqual(expectedNumberOfCards, numberOfCards);
        }
Beispiel #2
0
        public void TheCardsShouldAllBeUniqueAfterTheShuffle()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards packOfCards = packOfCardsCreator.Create();

            packOfCards.Shuffle();

            CollectionAssert.AllItemsAreUnique(packOfCards);
        }
Beispiel #3
0
        public void TheCardShouldNoLongerBeInThePackAfterACardIsRemoved()
        {
            IPackOfCardsCreator packOfCardsCreator = new PackOfCardsCreator();
            IPackOfCards packOfCards = packOfCardsCreator.Create();

            ICard cardRemoved = packOfCards.TakeCardFromTopOfPack();

            CollectionAssert.DoesNotContain(packOfCards, cardRemoved);
        }
Beispiel #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);
        }
Beispiel #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);
        }