GameLevelTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  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

public class GameLevelTests : CreepyTowersGameForTests

The GameLevelTests type exposes the following members.

Constructors

  NameDescription
Public methodGameLevelTests
Initializes a new instance of the GameLevelTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodDisplayCreepWalkingInALevel
Public methodDisplayCreepWalkingViaPathfinding
Public methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodInitialize (Overrides CreepyTowersGameForTests Initialize .)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Public methodRestartLevel
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Fields

  NameDescription
Protected fieldgame (Inherited from CreepyTowersGameForTests.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
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