GameTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    TinyPlatformer.Tests GameTests

Namespace: TinyPlatformer.Tests
Assembly: TinyPlatformer.Tests (in TinyPlatformer.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 methodCursorLeftMakesPlayerWantToMoveLeft
Public methodCursorRightMakesPlayerWantToMoveRight
Public methodCursorUpMakesPlayerWantToJump
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodPlayerDoesNotWantToMoveLeftOrRight
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Public methodReleasingCursorLeftMakesPlayerStopWantingToMoveLeft
Public methodReleasingCursorRightMakesPlayerStopWantingToMoveRight
Public methodReleasingCursorUpMakesPlayerStopWantingToJump
Public methodReleasingSpaceMakesPlayerStopWantingToJump
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetUp
Public methodSpaceMakesPlayerWantToJump
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void PlayerDoesNotWantToMoveLeftOrRight()
{
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void CursorLeftMakesPlayerWantToMoveLeft()
{
    PressKey(Key.CursorLeft);
    Assert.IsTrue(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void CursorRightMakesPlayerWantToMoveRight()
{
    PressKey(Key.CursorRight);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsTrue(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void CursorUpMakesPlayerWantToJump()
{
    PressKey(Key.CursorUp);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsTrue(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void SpaceMakesPlayerWantToJump()
{
    PressKey(Key.Space);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsTrue(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void ReleasingCursorLeftMakesPlayerStopWantingToMoveLeft()
{
    PressKey(Key.CursorLeft);
    ReleaseKey(Key.CursorLeft);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void ReleasingCursorRightMakesPlayerStopWantingToMoveRight()
{
    PressKey(Key.CursorRight);
    ReleaseKey(Key.CursorRight);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void ReleasingCursorUpMakesPlayerStopWantingToJump()
{
    PressKey(Key.CursorUp);
    ReleaseKey(Key.CursorUp);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test, CloseAfterFirstFrame]
public void ReleasingSpaceMakesPlayerStopWantingToJump()
{
    PressKey(Key.Space);
    ReleaseKey(Key.Space);
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
See Also