public void IsThereEnoughManaForSelectedCardTests()
        {
            byte manaOfPlayer = 2;
            byte manaCost     = 3;

            bool isThereEnoughManaForSelectedCard = _operations.IsThereEnoughManaForSelectedCard(manaCost, manaOfPlayer);

            Assert.AreEqual(false, isThereEnoughManaForSelectedCard);

            manaOfPlayer = 4;
            manaCost     = 4;

            isThereEnoughManaForSelectedCard = _operations.IsThereEnoughManaForSelectedCard(manaCost, manaOfPlayer);

            Assert.AreEqual(true, isThereEnoughManaForSelectedCard);
        }
Example #2
0
        /// <summary>
        /// Selects attack card through asking to player.
        /// </summary>
        /// <returns>Returns true if card successfully selected, otherwise returns false</returns>
        private bool AttackCardSelection(out ICard selectedAttackCard)
        {
            selectedAttackCard = _io.AskToPlayerForAttackCardSelection(_activePlayer);

            if (selectedAttackCard == null)
            {
                return(false);
            }

            if (_operations.IsThereEnoughManaForSelectedCard(selectedAttackCard.ManaCost, _activePlayer.Mana))
            {
                return(true);
            }

            _io.NotEnoughManaToPlaySelectedCardMessage();

            return(AttackCardSelection(out selectedAttackCard));
        }