Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
CreepyTowers.Tests CreepyTowersGameForTests
CreepyTowers.Tests.Avatars PiggyBankTests
Namespace: CreepyTowers.Tests.Avatars
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The PiggyBankTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
PiggyBankTests | Initializes a new instance of the PiggyBankTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
Dispose | (Inherited from CreepyTowersGameForTests.) | |
Initialize | (Inherited from CreepyTowersGameForTests.) | |
InitializeCreepyTowersMockContentLoader | (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
PiggyBankPayDayBuffLasts5Seconds | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetUp | ||
SpawnCoinMinefield | ||
TriggeringPiggyBankPayDayMakesCreepsDropMoreGold |
Fields
Name | Description | |
---|---|---|
game | (Inherited from CreepyTowersGameForTests.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void SpawnCoinMinefield() { Assert.AreEqual(5, coins.Count); Assert.AreEqual(new Vector3D(0.5f, 1.5f, 0.0f), coins[0].Position); Assert.IsTrue(coins[0].IsActive); }
[Test] public void TriggeringPiggyBankPayDayMakesCreepsDropMoreGold() { var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f)); var gold = creep.GetStatValue("Gold"); pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused); AdvanceTimeAndUpdateEntities(4.9f); Assert.AreEqual(1.5f, creep.GetStatValue("Gold") / gold); }
[Test] public void PiggyBankPayDayBuffLasts5Seconds() { var creep = new Creep(CreepType.Cloth, new Vector2D(0.5f, 1.5f)); var gold = creep.GetStatValue("Gold"); pig.PerformAttack(AvatarAttack.PiggyBankPayDay, Vector2D.Unused); AdvanceTimeAndUpdateEntities(5.1f); Assert.GreaterOrEqual(creep.GetStatValue("Gold"), gold); }
See Also