IronCreepStateChangerTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests.Creeps IronCreepStateChangerTests

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

public class IronCreepStateChangerTests : TestWithMocksOrVisually

The IronCreepStateChangerTests type exposes the following members.

Constructors

  NameDescription
Public methodIronCreepStateChangerTests
Initializes a new instance of the IronCreepStateChangerTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodApplyAcidThenWater
Public methodApplyingIceToMeltedIronCreepMightNotShatter
Public methodApplyingIceToMeltedIronCreepMightShatter
Public methodCheckForAcidTowerEffect
Public methodCheckForFireTowerEffect
Public methodCheckForWaterTowerEffect
Public methodCreateClothCreep
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
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void CheckForFireTowerEffect()
{
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Fire, creep);
    Assert.IsTrue(creep.State.Melt);
    Assert.AreEqual(Vulnerability.Normal,
        creep.State.VulnerabilityState[(int)TowerType.Slice]);
    Assert.AreEqual(Vulnerability.Weak,
        creep.State.VulnerabilityState[(int)TowerType.Impact]);
}
[Test, CloseAfterFirstFrame]
public void CheckForAcidTowerEffect()
{
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Acid, creep);
    Assert.IsTrue(creep.State.Melt);
}
[Test, CloseAfterFirstFrame]
public void CheckForWaterTowerEffect()
{
    StateChanger.CheckCreepState(TowerType.Water, creep);
    Assert.IsTrue(creep.State.Rust);
}
[Test, CloseAfterFirstFrame]
public void ApplyAcidThenWater()
{
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Acid, creep);
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Water, creep);
    Assert.AreEqual(Vulnerability.Vulnerable,
        creep.State.VulnerabilityState[(int)TowerType.Water]);
    Assert.AreEqual(Vulnerability.HardBoiled,
        creep.State.VulnerabilityState[(int)TowerType.Slice]);
    Assert.AreEqual(Vulnerability.Resistant,
        creep.State.VulnerabilityState[(int)TowerType.Impact]);
}
[Test, CloseAfterFirstFrame]
public void ApplyingIceToMeltedIronCreepMightShatter()
{
    Randomizer.Use(new FixedRandom(new[] { 0.0f }));
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Ice, creep);
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Acid, creep);
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Ice, creep);
    Assert.AreEqual(0, creep.GetStatValue("Hp"));
}
[Test, CloseAfterFirstFrame]
public void ApplyingIceToMeltedIronCreepMightNotShatter()
{
    Randomizer.Use(new FixedRandom(new[] { 0.9f }));
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Ice, creep);
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Acid, creep);
    IronCreepStateChanger.ChangeStatesIfIronCreep(TowerType.Ice, creep);
    Assert.AreEqual(1, creep.GetStatPercentage("Hp"));
}
See Also