GameTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    CreepyTowers.Tests TestWithCreepyTowersMockContentLoaderOrVisually
      CreepyTowers.Tests CreepyTowersGameForTests
        CreepyTowers.Tests GameTests

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

public class GameTests : CreepyTowersGameForTests

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 methodDispose (Inherited from CreepyTowersGameForTests.)
Public methodExitingGameRemovesAllEntities
Public methodInitialize (Inherited from CreepyTowersGameForTests.)
Public methodInitializeCreepyTowersMockContentLoader (Inherited from TestWithCreepyTowersMockContentLoaderOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodMessageCreditsUpdated
Public methodMessageInsufficientMoney
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
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, Ignore]
public void MessageInsufficientMoney()
{
    int amountRequired = 0;
    game.InsufficientCredits += i => { amountRequired = i; };
    game.MessageInsufficientMoney(100);
    Assert.AreEqual(100, amountRequired);
}
[Test]
public void MessageCreditsUpdated()
{
    int difference = 0;
    game.CreditsUpdated += i => { difference = i; };
    game.MessageCreditsUpdated(100);
    Assert.AreEqual(100, difference);
}
[Test]
public void ExitingGameRemovesAllEntities()
{
    MockGame.ExitGame();
    Assert.AreEqual(0, EntitiesRunner.Current.GetAllEntities().Count);
}
See Also