Example #1
0
        public void RestoreManaMethod_AppropriatelyAltersCurrentMana()
        {
            const int manaSpent = FighterMana - 1;

            _fighter.DrainMana(manaSpent);
            var ret = _fighter.RestoreMana(manaSpent - 2);

            Assert.AreEqual(FighterMana - 2, _fighter.CurrentMana);
            Assert.AreEqual(FighterMana, _fighter.MaxMana);

            Assert.AreEqual(2, ret);
        }
Example #2
0
        public void RestoreManaMethod_AppropriatelyRaisesEvents_ManaAmountIsLessThanMaxMana()
        {
            _fighter.SetMana(10, 0);
            _fighter.RestoreMana(8);

            var logs = _logger.Logs;

            Assert.AreEqual(1, logs.Count);
            Assert.AreEqual(EventType.ManaRestored, logs[0].Type);
            Assert.AreEqual(_fighter, logs[0].Sender);
            var e = logs[0].E as ManaRestoredEventArgs;

            Assert.That(e, Is.Not.Null);
            if (e != null)
            {
                Assert.AreEqual(8, e.ManaRestored);
            }
        }