GameTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    SideScroller.Tests GameTests

Namespace: SideScroller.Tests
Assembly: SideScroller.Tests (in SideScroller.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class GameTests : TestWithMocksOrVisually

The GameTests type exposes the following members.

Constructors

  NameDescription
Public methodGameTests
Initializes a new instance of the GameTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreateEnemiesAFterPointInTime
Public methodCreateNewGame
Public methodExitGame
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodStartTheGame
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void StartTheGame()
{
    var startButton = (InteractiveButton)game.mainMenu.Controls[IndexOfStartButton];
    startButton.Clicked.Invoke();
    Assert.IsNotNull(game.player);
}
[Test]
public void ExitGame()
{
    var exitButton = (InteractiveButton)game.mainMenu.Controls[IndexOfExitButton];
    exitButton.Clicked.Invoke();
}
[Test]
public void CreateEnemiesAFterPointInTime()
{
    game.StartGame();
    AdvanceTimeAndUpdateEntities(TimeToSpawnNewEnemy + 0.1f);
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<EnemyPlane>().Count);
}
See Also