Ejemplo n.º 1
0
        public void ConsumeAndItem()
        {
            var caster = new Mock<ISceneActor>();
            var target = new Mock<ISceneActor>();

            HealthPotion hpPotion = new HealthPotion() { Value = 50.0f};
            UseItem useItem = new UseItem() { Item = hpPotion };
            useItem.Target = target.Object;
            useItem.Caster= caster.Object;

            target.Setup(x => x.GetDerivativeStatNamed("Health")).Returns(new DerivativeStat(new Stat("Strenght", 10), 15));
            useItem.Resolve();
            var targetHP = target.Object.GetDerivativeStatNamed("Health");
            Assert.AreEqual(targetHP.CurrentValue, 200.0f);
        }
Ejemplo n.º 2
0
        public void ConsumeAndItem()
        {
            var caster = new Mock <ISceneActor>();
            var target = new Mock <ISceneActor>();

            HealthPotion hpPotion = new HealthPotion()
            {
                Value = 50.0f
            };
            UseItem useItem = new UseItem()
            {
                Item = hpPotion
            };

            useItem.Target = target.Object;
            useItem.Caster = caster.Object;

            target.Setup(x => x.GetDerivativeStatNamed("Health")).Returns(new DerivativeStat(new Stat("Strenght", 10), 15));
            useItem.Resolve();
            var targetHP = target.Object.GetDerivativeStatNamed("Health");

            Assert.AreEqual(targetHP.CurrentValue, 200.0f);
        }