Esempio n. 1
0
        public void TestHumanFighter_CorrectlyDies_SetDeathOnTurnEndEventCalled()
        {
            _fighter.SetHealth(100);
            _fighter.SetDeathOnTurnEndEvent();

            Assert.AreEqual(100, _fighter.CurrentHealth);

            _fighter.OnTurnEnded(new TurnEndedEventArgs(_fighter));

            Assert.AreEqual(0, _fighter.CurrentHealth);
        }
Esempio n. 2
0
        public void FighterStatusCounterTicksDown_OnTurnEnd()
        {
            Status status = new MagicMultiplierStatus(3, MagicType.Lightning, 1.25);

            _humanFighter.AddStatus(status);

            _humanFighter.OnTurnEnded(new TurnEndedEventArgs(_humanFighter));

            Status returnedStatus = _humanFighter.Statuses[0];

            Assert.AreEqual(2, returnedStatus.TurnCounter);
        }
Esempio n. 3
0
        public void OnTurnEndMethod_AppropriatelyFiresTurnEndEvent()
        {
            _fighter.OnTurnEnded(new TurnEndedEventArgs(_fighter));

            var logs = _logger.Logs;

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

            Assert.NotNull(e);
            Assert.AreEqual(_fighter, e.Fighter);
        }