public void IsThereEnoughManaForPlayabilityTests()
        {
            var hand = new List <ICard>
            {
                new Card {
                    ManaCost = 1
                }, new Card {
                    ManaCost = 2
                },
                new Card {
                    ManaCost = 3
                }, new Card {
                    ManaCost = 4
                }
            };

            byte manaOfPlayer = 2;

            bool isThereEnoughManaForPlayability = _operations.IsThereEnoughManaForPlayability(hand, manaOfPlayer);

            Assert.AreEqual(true, isThereEnoughManaForPlayability);

            hand = new List <ICard>
            {
                new Card {
                    ManaCost = 5
                }, new Card {
                    ManaCost = 4
                },
                new Card {
                    ManaCost = 3
                }, new Card {
                    ManaCost = 6
                }
            };

            isThereEnoughManaForPlayability = _operations.IsThereEnoughManaForPlayability(hand, manaOfPlayer);

            Assert.AreEqual(false, isThereEnoughManaForPlayability);
        }
Exemple #2
0
        /// <summary>
        /// Checks active player statuses for game play.
        /// </summary>
        /// <returns>Returns false if active player can not continue to play, otherwise returns true</returns>
        private bool CheckPlayability()
        {
            if (!_operations.AreThereAnyPlayableCardInHand(_activePlayer.Hand))
            {
                _io.ThereAreNotAnyPlayableCardMessage();

                return(false);
            }

            if (_operations.IsThereEnoughManaForPlayability(_activePlayer.Hand, _activePlayer.Mana))
            {
                return(true);
            }

            _io.NotEnoughManaToPlayAnyCardMessage();

            return(false);
        }