CalculateDamageTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
      CreepyTowers.Tests CreepyTowersGameForTests
        CreepyTowers.Tests.Creeps CalculateDamageTests

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

public class CalculateDamageTests : CreepyTowersGameForTests

The CalculateDamageTests type exposes the following members.

Constructors

  NameDescription
Public methodCalculateDamageTests
Initializes a new instance of the CalculateDamageTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCheckResistanceBasedOnHardboiledType
Public methodCheckResistanceBasedOnImmuneType
Public methodCheckResistanceBasedOnNormalDamageType
Public methodCheckResistanceBasedOnResistantType
Public methodCheckResistanceBasedOnVulnerableType
Public methodCheckResistanceBasedOnWeakType
Public methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodInitialize (Inherited from CreepyTowersGameForTests.)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Fields

  NameDescription
Protected fieldgame (Inherited from CreepyTowersGameForTests.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnImmuneType()
{
    var creep = new Creep(CreepType.Glass, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Acid);
    Assert.AreEqual(0.1f, resistance);
}
[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnVulnerableType()
{
    var creep = new Creep(CreepType.Glass, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Impact);
    Assert.AreEqual(3.0f, resistance);
}
[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnResistantType()
{
    var creep = new Creep(CreepType.Sand, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Impact);
    Assert.AreEqual(0.5f, resistance);
}
[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnHardboiledType()
{
    var creep = new Creep(CreepType.Cloth, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Ice);
    Assert.AreEqual(0.25f, resistance);
}
[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnWeakType()
{
    var creep = new Creep(CreepType.Cloth, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Slice);
    Assert.AreEqual(2.0f, resistance);
}
[Test, CloseAfterFirstFrame]
public void CheckResistanceBasedOnNormalDamageType()
{
    var creep = new Creep(CreepType.Cloth, Vector3D.Zero);
    var resistance = creep.State.GetVulnerabilityValue(TowerType.Water);
    Assert.AreEqual(1.0f, resistance);
}
See Also