Exemple #1
0
        /// <summary>
        /// Provides a method for creating a Al Cabohne unshaken Bohnanza card deck.
        /// </summary>
        /// <returns></returns>
        public static DeckTypes.CardPile ProduceAlCabohneDeck()
        {
            //Define a result
            var result = new DeckTypes.CardPile();

            //Iterate over each type of card
            foreach( AlCabohneCard.CardEnum value in Enum.GetValues(typeof(AlCabohneCard.CardEnum)) )
            {
                //Get the number of cards we should have in the game of this type
                var card = new AlCabohneCard(value);

                //Number of cards of this type in the whole game
                int numberOfCards = card.TotalNumberOfCards;

                //Iterate a number of times until we added enough cards of this type to the deck
                do
                {
                    //Get a card of this type
                    card = new AlCabohneCard(value);

                    //Add this card to the cardPile
                    result.PutCard(card);

                    //Decrement number of cards
                    numberOfCards--;

                } while (numberOfCards > 0);
            }

            return result;
        }
 public void EqualsTest()
 {
     var target = new AlCabohneCard(AlCabohneCard.CardEnum.FireBeans);
     var actual = target.Equals(firebeancard);
     Assert.IsTrue(actual);
 }
 public void AlCabohneCardConstructorTest()
 {
     var target = new AlCabohneCard(AlCabohneCard.CardEnum.FireBeans);
     Assert.IsInstanceOfType(target, typeof(AlCabohneCard));
 }
 public static void MyClassInitialize(TestContext testContext)
 {
     firebeancard = new AlCabohneCard(AlCabohneCard.CardEnum.FireBeans);
 }