Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
CreepyTowers.Tests.Creeps MovementTests
Namespace: CreepyTowers.Tests.Creeps
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The MovementTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MovementTests | Initializes a new instance of the MovementTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CreepWithNoPathDoesntMove | ||
DelayedCreepMovesAtThirdSpeed | ||
FastCreepMovesAtDoubleSpeed | ||
FrozenCreepDoesNotMove | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
ParalyzedCreepDoesNotMove | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetUp | ||
SlowCreepMovesAtHalfSpeed | ||
UnchangedCreepMovesAtDefaultSpeed |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void ParalyzedCreepDoesNotMove() { creep.State.Paralysed = true; AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(Vector3D.Zero, creep.Position); }
[Test, CloseAfterFirstFrame] public void FrozenCreepDoesNotMove() { creep.State.Frozen = true; AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(Vector3D.Zero, creep.Position); }
[Test, CloseAfterFirstFrame] public void DelayedCreepMovesAtThirdSpeed() { creep.State.Delayed = true; AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(0.333f, creep.Position.X, 0.001f); }
[Test, CloseAfterFirstFrame] public void SlowCreepMovesAtHalfSpeed() { creep.State.Slow = true; AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(0.5f, creep.Position.X, 0.001f); }
[Test, CloseAfterFirstFrame] public void FastCreepMovesAtDoubleSpeed() { creep.State.Fast = true; AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(2.0f, creep.Position.X, 0.001f); }
[Test, CloseAfterFirstFrame] public void UnchangedCreepMovesAtDefaultSpeed() { AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(1.0f, creep.Position.X, 0.001f); }
[Test, CloseAfterFirstFrame] public void CreepWithNoPathDoesntMove() { creep.Path = new List<Vector2D>(); AdvanceTimeAndUpdateEntities(1); Assert.AreEqual(0.0f, creep.Position.X); }
See Also