AgentTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
      CreepyTowers.Tests CreepyTowersGameForTests
        CreepyTowers.Tests AgentTests

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

public class AgentTests : CreepyTowersGameForTests

The AgentTests type exposes the following members.

Constructors

  NameDescription
Public methodAgentTests
Initializes a new instance of the AgentTests class
Top
Methods

  NameDescription
Public methodAdjustStatDownwards
Public methodAdjustStatUpwards
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodApplyBuff
Public methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodElapsedBuffExpires
Public methodInitialize (Overrides CreepyTowersGameForTests Initialize .)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodInitialValues
Public methodNotElapsedBuffDoesNotExpire
Public methodReceiveBuffOnAttributeItDoesNotHave
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]
public void InitialValues()
{
    Assert.AreEqual(100.0, creep.GetStatValue("Hp"));
    Assert.AreEqual(1.0, creep.GetStatPercentage("Hp"));
}
[Test]
public void ApplyBuff()
{
    creep.ApplyBuff(new BuffEffect("TestHpBuff"));
    Assert.AreEqual(304.0, creep.GetStatValue("Hp"));
    Assert.AreEqual(100.0, creep.GetStatBaseValue("Hp"));
    Assert.AreEqual(1.0, creep.GetStatPercentage("Hp"));
}
[Test]
public void ReceiveBuffOnAttributeItDoesNotHave()
{
    Assert.DoesNotThrow(() => creep.ApplyBuff(new BuffEffect("DragonRangeMultiplier")));
}
[Test, CloseAfterFirstFrame]
public void AdjustStatDownwards()
{
    creep.AdjustStat(new StatAdjustment("Hp", "", -50.0f));
    Assert.AreEqual(50.0f, creep.GetStatValue("Hp"));
}
[Test, CloseAfterFirstFrame]
public void AdjustStatUpwards()
{
    creep.AdjustStat(new StatAdjustment("Hp", "", -50.0f));
    creep.AdjustStat(new StatAdjustment("Hp", "", 20.0f));
    Assert.AreEqual(70.0f, creep.GetStatValue("Hp"));
}
[Test, CloseAfterFirstFrame, Ignore]
public void NotElapsedBuffDoesNotExpire()
{
    creep.ApplyBuff(new BuffEffect("TestGoldBuff"));
    AdvanceTimeAndUpdateEntities(1.0f);
    Assert.AreEqual(23.0f, creep.GetStatValue("Gold"));
}
[Test, CloseAfterFirstFrame, Ignore]
public void ElapsedBuffExpires()
{
    creep.ApplyBuff(new BuffEffect("TestGoldBuff"));
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Creep>().Count);
    AdvanceTimeAndUpdateEntities(7.0f);
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Creep>().Count);
    Assert.AreEqual(13.0f, creep.GetStatValue("Gold"));
}
See Also