CreepStateTests ClassDelta Engine Documentation
Inheritance Hierarchy

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

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

public class CreepStateTests : CreepyTowersGameForTests

The CreepStateTests type exposes the following members.

Constructors

  NameDescription
Public methodCreepStateTests
Initializes a new instance of the CreepStateTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
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.)
Public methodTestCreepState
Public methodTestFrozenState
Public methodTestMeltState
Public methodTestSlowImmuneState
Top
Fields

  NameDescription
Protected fieldgame (Inherited from CreepyTowersGameForTests.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void TestCreepState()
{
    var state = new CreepState();
    state.SetVulnerabilityWithValue(TowerType.Ice, 1000f);
    Assert.AreEqual(Vulnerability.Sudden, state.GetVulnerability(TowerType.Ice));
}
[Test]
public void TestFrozenState()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    var state = new CreepState();
    state.Frozen = true;
    state.UpdateStateAndTimers(creep);
    Assert.IsTrue(state.Frozen);
    state.Unfreezable = true;
    state.UpdateStateAndTimers(creep);
    Assert.IsTrue(state.Unfreezable);
}
[Test]
public void TestMeltState()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    var state = new CreepState();
    state.Melt = true;
    state.UpdateStateAndTimers(creep);
    Assert.IsTrue(state.Melt);
}
[Test]
public void TestSlowImmuneState()
{
    var creep = new Creep(CreepType.Cloth, Vector2D.Zero);
    var state = new CreepState();
    state.Slow = true;
    state.UpdateStateAndTimers(creep);
    Assert.IsTrue(state.Slow);
    state.SlowImmune = true;
    state.UpdateStateAndTimers(creep);
    Assert.IsTrue(state.SlowImmune);
}
See Also