示例#1
0
        public void Trigger_IsTriggeredOncePerEvent()
        {
            var valueToModify = 0;

            (Friend2 as ITriggerAttachee <Unit>)
            .AttachTrigger(new DamageTrigger(delegate { valueToModify++; }));

            Friend2.Damage(1);
            Friend2.Damage(1);

            Assert.AreEqual(2, valueToModify);
        }
示例#2
0
        public void HealAffectsTarget()
        {
            var healValue = 3;

            Friend2.Damage(4);
            var expectedHealth = Friend2.Life + healValue;

            var heal = new HealActionArgs(Friend1, Friend2, () => healValue);

            heal.Execute();

            Assert.AreEqual(expectedHealth, Friend2.Life);
        }