Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
CreepyTowers.Tests CreepyTowersGameForTests
CreepyTowers.Tests.Creeps CalculateDamageTests
Namespace: CreepyTowers.Tests.Creeps
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The CalculateDamageTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CalculateDamageTests | Initializes a new instance of the CalculateDamageTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CheckResistanceBasedOnHardboiledType | ||
CheckResistanceBasedOnImmuneType | ||
CheckResistanceBasedOnNormalDamageType | ||
CheckResistanceBasedOnResistantType | ||
CheckResistanceBasedOnVulnerableType | ||
CheckResistanceBasedOnWeakType | ||
Dispose | (Inherited from CreepyTowersGameForTests.) | |
Initialize | (Inherited from CreepyTowersGameForTests.) | |
InitializeCreepyTowersMockContentLoader | (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
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, CloseAfterFirstFrame] public void CheckResistanceBasedOnImmuneType() { var creep = new Creep(CreepType.Glass, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Acid); Assert.AreEqual(0.1f, resistance); }
[Test, CloseAfterFirstFrame] public void CheckResistanceBasedOnVulnerableType() { var creep = new Creep(CreepType.Glass, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Impact); Assert.AreEqual(3.0f, resistance); }
[Test, CloseAfterFirstFrame] public void CheckResistanceBasedOnResistantType() { var creep = new Creep(CreepType.Sand, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Impact); Assert.AreEqual(0.5f, resistance); }
[Test, CloseAfterFirstFrame] public void CheckResistanceBasedOnHardboiledType() { var creep = new Creep(CreepType.Cloth, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Ice); Assert.AreEqual(0.25f, resistance); }
[Test, CloseAfterFirstFrame] public void CheckResistanceBasedOnWeakType() { var creep = new Creep(CreepType.Cloth, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Slice); Assert.AreEqual(2.0f, resistance); }
[Test, CloseAfterFirstFrame] public void CheckResistanceBasedOnNormalDamageType() { var creep = new Creep(CreepType.Cloth, Vector3D.Zero); var resistance = creep.State.GetVulnerabilityValue(TowerType.Water); Assert.AreEqual(1.0f, resistance); }
See Also