Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
CreepyTowers.Tests CreepyTowersGameForTests
CreepyTowers.Tests GameLevelTests
Namespace: CreepyTowers.Tests
Assembly: CreepyTowers.Tests (in CreepyTowers.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The GameLevelTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
GameLevelTests | Initializes a new instance of the GameLevelTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
DisplayCreepWalkingInALevel | ||
DisplayCreepWalkingViaPathfinding | ||
Dispose | (Inherited from CreepyTowersGameForTests.) | |
Initialize | (Overrides CreepyTowersGameForTests Initialize .) | |
InitializeCreepyTowersMockContentLoader | (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.) | |
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RestartLevel | ||
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 DisplayCreepWalkingInALevel() { gameLevel.ModelName = "N1C1ChildsRoom"; gameLevel.RenderLevel(); var creep = new Creep(CreepType.Cloth, new Vector2D(9, 5) + Vector2D.Half); creep.Path = new List<Vector2D> { (new Vector2D(9, 12) + Vector2D.Half), (new Vector2D(13, 12) + Vector2D.Half), (new Vector2D(13, 6) + Vector2D.Half), (new Vector2D(9, 6) + Vector2D.Half) }; creep.FinalTarget = creep.Path[creep.Path.Count - 1]; }
[Test] public void DisplayCreepWalkingViaPathfinding() { var creep = new Creep(CreepType.Cloth, gameLevel.SpawnPoints[0]); var path = gameLevel.GetPath(gameLevel.SpawnPoints[0], gameLevel.GoalPoints[0]).GetListOfCoordinates(); creep.Path = path.Select(element => element + Vector2D.Half).ToList(); }
[Test, CloseAfterFirstFrame, Ignore] public void RestartLevel() { Assert.Less(player.Gold, 4000); gameLevel.Restart(); Assert.AreEqual(4000, player.Gold); }
See Also