Beispiel #1
0
        public void testAtaqueInterfazfloat()
        {
            String[]        golpe = { "golpe" };
            var             d     = new Float(3f);
            iAttack <float> atk   = new AttackSimple <float>(golpe[0], d);
            var             atkcp = atk.copy();

            Assert.AreEqual(atk.getTypes(), golpe);
            Assert.AreEqual(atk.getTypes(), atkcp.getTypes());
            Assert.AreEqual(atk.getAttack(golpe[0]), 3);
            Assert.AreEqual(atk.getAttack(golpe[0]), atkcp.getAttack(golpe[0]));
        }
Beispiel #2
0
        public void testCrearDamageyUsarDescontar()
        {
            string gp      = "golpe";
            var    mainatk = new AttackComplex <float>(new Float(0f), new Float(10f));
            var    iAtt    = mainatk.cast().addAttack(new AttackSimple <float>(gp, new Float(10f)));
            var    damage  = new Damage(iAtt);

            var atk = new AttackSimple <float>(gp, new Float(5f));

            Assert.AreEqual(damage.descontar(atk), 5f);
            Assert.AreEqual(iAtt.getAttack(gp), 5f);
        }
Beispiel #3
0
        public void testAtaqueInterfazUINT()
        {
            string[]       golpe = { "golpe" };
            var            d     = new UInt(3);
            iAttack <uint> atk   = new AttackSimple <uint>(golpe[0], d);
            var            atkcp = atk.copy();

            //atq.Ataque queda testeado por iVar
            Assert.AreEqual(atk.getTypes(), golpe);
            Assert.AreEqual(atk.getTypes(), atkcp.getTypes());
            Assert.AreEqual(atk.getAttack(golpe[0]), 3);
            Assert.AreEqual(atk.getAttack(golpe[0]), atkcp.getAttack(golpe[0]));
        }
Beispiel #4
0
        public void testCrearDamageyUsarRemanente()
        {
            string gp   = "golpe";
            var    mock = Mock.Of <iAttack <float> >();
            //Assume.That( () => true);
            var mainatk = new AttackComplex <float>(new Float(0f), new Float(10f));
            var iAtt    = mainatk.cast().addAttack(new AttackSimple <float>(gp, new Float(10f)));
            var damage  = new Damage(iAtt);


            var atk = new AttackSimple <float>(gp, new Float(0.5f));

            Assert.AreEqual(damage.remanente(atk), 5f);
            Assert.AreEqual(iAtt.getAttack(gp), 5f);
        }