CreepTests CheckReceiveAttack Method Delta Engine Documentation

Namespace: CreepyTowers.Tests.Creeps
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void CheckReceiveAttack()
Examples

[Test, CloseAfterFirstFrame]
public void CheckReceiveAttack()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    creep.ReceiveAttack(TowerType.Fire, 10.0f);
    Assert.AreEqual(100.0f, creep.GetStatValue("Hp"));
}
[Test, CloseAfterFirstFrame]
public void CheckReceiveAttackWithInactiveCreep()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    creep.IsActive = false;
    creep.ReceiveAttack(TowerType.Fire, 10.0f);
    Assert.IsFalse(creep.IsActive);
    Assert.AreEqual(creep.GetStatValue("Hp"), creep.GetStatBaseValue("Hp"));
}
[Test, CloseAfterFirstFrame]
public void CheckReceiveAttackWithDeadCreep()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    creep.AdjustStat(new StatAdjustment("Hp", "", -195));
    creep.ReceiveAttack(TowerType.Fire, 10.0f);
    Assert.AreEqual(0.0f, creep.GetStatValue("Hp"));
}
See Also