Esempio n. 1
0
        public void TestSeveralHands()
        {
            IList <ICard> cardCollection = new List <ICard>();
            Random        getValue       = new Random();

            string randomValue;
            string randomSuit;

            for (int i = 0; i < 5; i++)
            {
                randomValue = values[getValue.Next(0, values.Length - 1)];
                randomSuit  = suits[getValue.Next(0, suits.Length - 1)];

                Card current = CardGenerator.Generate(randomValue, randomSuit);

                if (!cardCollection.Contains(current))
                {
                    cardCollection.Add(current);
                }
                else
                {
                    i--;
                }
            }

            Hand cards = new Hand(cardCollection);

            Assert.AreEqual(string.Join(", ", cardCollection), cards.ToString());
        }
Esempio n. 2
0
        public void TestCadrs(string typeValue, string suit)
        {
            Card randomCard = CardGenerator.Generate(typeValue, suit);

            Assert.AreEqual(typeValue + suit, randomCard.ToString());
        }