Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
CreepyTowers.Tests CreepyTowersGameForTests
CreepyTowers.Tests.Stats BuffTests
Namespace: CreepyTowers.Tests.Stats
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The BuffTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BuffTests | Initializes a new instance of the BuffTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
Constructor | ||
Dispose | (Inherited from CreepyTowersGameForTests.) | |
Initialize | (Inherited from CreepyTowersGameForTests.) | |
InitializeCreepyTowersMockContentLoader | (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
IsExpiredWhenElapsedIsAboveDuration | ||
IsNotExpiredWhenDurationIsZero | ||
IsNotExpiredWhenElapsedIsBelowDuration | ||
Properties | ||
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 Constructor() { var stat = new Stat(100.0f); var effect = new BuffEffect("TestGoldBuff"); var buff = new Buff(stat, effect); Assert.AreEqual(stat, buff.Stat); Assert.AreEqual(effect, buff.Effect); Assert.AreEqual(0, buff.Elapsed); }
[Test] public void Properties() { var stat = new Stat(100.0f); const float Elapsed = 4.0f; var effect = new BuffEffect("TestGoldBuff"); var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff")) { Stat = stat, Effect = effect, Elapsed = Elapsed }; Assert.AreEqual(stat, buff.Stat); Assert.AreEqual(effect, buff.Effect); Assert.AreEqual(Elapsed, buff.Elapsed); }
[Test] public void IsNotExpiredWhenDurationIsZero() { var buff = new Buff(new Stat(0.0f), new BuffEffect("DragonRangeMultiplier")) { Elapsed = 10 }; Assert.IsFalse(buff.IsExpired); }
[Test] public void IsNotExpiredWhenElapsedIsBelowDuration() { var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff")) { Elapsed = 4}; Assert.IsFalse(buff.IsExpired); }
[Test] public void IsExpiredWhenElapsedIsAboveDuration() { var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff")) { Elapsed = 10 }; Assert.IsTrue(buff.IsExpired); }
See Also