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); }
public void testAttackComplexInterfazFloat() { AttackComplex <float> atk = new AttackComplex <float>(new Float(0f), new Float(3f)); string[] cadena = { "golpe pecho", "golpe cabeza", "golpe pies" }; Float pt = new Float(3f); atk.cast().addAttack(new AttackSimple <float>("golpe pecho", pt)); atk.cast().addAttack(new AttackSimple <float>("golpe cabeza", pt)); atk.cast().addAttack(new AttackSimple <float>("golpe pies", pt)); var attack = (atk as iAttack <float>); var atkcp = attack.copy(); Assert.AreEqual(attack.getTypes(), cadena); Assert.AreEqual(attack.getTypes(), atkcp.getTypes()); foreach (string elem in cadena) { Assert.AreEqual(attack.getAttack(elem), pt.get()); Assert.AreEqual(attack.getAttack(elem), atkcp.getAttack(elem)); } }
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); }