Beispiel #1
0
        public void APileCanBePutUpsideDown()
        {
            var pile1 = CardsPack.GetNew32CardsPack();
            var pile2 = CardsPack.GetNew32CardsPack();

            pile2.PutUpsideDown();
            Assert.AreEqual(32, pile2.CardsCount);

            for (int i = 1; i < 33; i++)
            {
                var c1 = pile1.ReadCard(i);
                var c2 = pile2.ReadCard(33 - i);
                Assert.AreEqual(c1.Value, c2.Value);
                Assert.AreEqual(c1.Color, c2.Color);
                Assert.AreNotEqual(c1.VisibleSide, c2.VisibleSide);
            }
        }
Beispiel #2
0
        public void WhatIsA_32CardsDeck()
        {
            var pile = CardsPack.GetNew32CardsPack();

            var aceOfSpades   = pile.ReadCard(1);
            var tenOfDiamonds = pile.ReadCard(13);
            var queenOfHearts = pile.ReadCard(23);
            var kingOfClubs   = pile.ReadCard(32);

            Assert.AreEqual(32, pile.CardsCount);

            Assert.AreEqual(eCardValue.Ace, aceOfSpades.Value, "The 1st card should be an Ace of Spades");
            Assert.AreEqual(eCardColor.Spades, aceOfSpades.Color, "The 1st card should be an Ace of Spades");
            Assert.AreEqual(eCardSide.Front, aceOfSpades.VisibleSide, "The 1st card should be an Ace of Spades");
            Assert.AreEqual(eCardValue.Ten, tenOfDiamonds.Value, "The 20th card should be an Seven of Diamonds");
            Assert.AreEqual(eCardColor.Diamonds, tenOfDiamonds.Color, "The 20th card should be an Seven of Diamonds");
            Assert.AreEqual(eCardSide.Front, tenOfDiamonds.VisibleSide, "The 20th card should be an Seven of Diamonds");
            Assert.AreEqual(eCardValue.Queen, queenOfHearts.Value, "The 38th card should be an Queen of Hearts");
            Assert.AreEqual(eCardColor.Hearts, queenOfHearts.Color, "The 38th card should be an Queen of Hearts");
            Assert.AreEqual(eCardSide.Front, queenOfHearts.VisibleSide, "The 38th card should be an Queen of Hearts");
            Assert.AreEqual(eCardValue.King, kingOfClubs.Value, "The 52nd card should be an King of Clubs");
            Assert.AreEqual(eCardColor.Clubs, kingOfClubs.Color, "The 52nd card should be an King of Clubs");
            Assert.AreEqual(eCardSide.Front, kingOfClubs.VisibleSide, "The 52nd card should be an King of Clubs");
        }