MenuTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    GhostWars.Tests MenuTests

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

public class MenuTests : TestWithMocksOrVisually

The MenuTests type exposes the following members.

Constructors

  NameDescription
Public methodMenuTests
Initializes a new instance of the MenuTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodBackToMenuOnGameOver
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Public methodRestartingStartsTheSameLevelAgain
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetGameOverAndRestartBackToCountDown
Public methodShowMenu
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, Ignore]
public void ShowMenu()
{
    Resolve<Settings>().Resolution = new Size(1200, 750);
    new MainMenu(Resolve<Window>());
}
[Test]
public void BackToMenuOnGameOver()
{
    GiveMenuSimulatingGameLost();
    Assert.AreEqual(MainMenu.State, GameState.Menu);
}
[Test]
public void SetGameOverAndRestartBackToCountDown()
{
    var menu = GiveMenuSimulatingGameLost();
    menu.RestartGame();
    Assert.AreEqual(MainMenu.State, GameState.CountDown);
}
[Test]
public void RestartingStartsTheSameLevelAgain()
{
    var menu = GiveMenuSimulatingGameLost(2);
    menu.RestartGame();
    Assert.AreEqual(2, menu.CurrentLevel);
}
See Also