Inheritance Hierarchy
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
The AgentTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
AgentTests | Initializes a new instance of the AgentTests class |
Methods
Name | Description | |
---|---|---|
AdjustStatDownwards | ||
AdjustStatUpwards | ||
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
ApplyBuff | ||
Dispose | (Inherited from CreepyTowersGameForTests.) | |
ElapsedBuffExpires | ||
Initialize | (Overrides CreepyTowersGameForTests Initialize .) | |
InitializeCreepyTowersMockContentLoader | (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
InitialValues | ||
NotElapsedBuffDoesNotExpire | ||
ReceiveBuffOnAttributeItDoesNotHave | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Fields
Name | Description | |
---|---|---|
game | (Inherited from CreepyTowersGameForTests.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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