ActorTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    TinyPlatformer.Tests ActorTests

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

public class ActorTests : TestWithMocksOrVisually

The ActorTests type exposes the following members.

Constructors

  NameDescription
Public methodActorTests
Initializes a new instance of the ActorTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCheckColors
Public methodCheckInitialMonsterDesiredMovement
Public methodCheckInitialPlayerDesiredMovement
Public methodCheckInitialTreasureDesiredMovement
Public methodCheckMaxAcceleration
Public methodCheckMaxFriction
Public methodCheckMaxVelocityX
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 methodSetUp
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void CheckMaxVelocityX()
{
    Assert.AreEqual(10 * Map.Meter, monster.MaxVelocityX);
    Assert.AreEqual(15 * Map.Meter, player.MaxVelocityX);
}
[Test]
public void CheckMaxAcceleration()
{
    Assert.AreEqual(player.MaxVelocityX / Actor.AccelerationFactor, player.maxAcceleration);
}
[Test]
public void CheckMaxFriction()
{
    Assert.AreEqual(player.MaxVelocityX / Actor.FrictionFactor, player.maxFriction);
}
[Test]
public void CheckColors()
{
    Assert.AreEqual(Color.Green, Actor.GetColor("player"));
    Assert.AreEqual(Color.Red, Actor.GetColor("monster"));
    Assert.AreEqual(Color.Yellow, Actor.GetColor("treasure"));
    Assert.AreEqual(Color.Pink, Actor.GetColor("unknown"));
}
[Test]
public void CheckInitialPlayerDesiredMovement()
{
    Assert.IsFalse(player.WantsToGoLeft);
    Assert.IsFalse(player.WantsToGoRight);
    Assert.IsFalse(player.WantsToJump);
}
[Test]
public void CheckInitialMonsterDesiredMovement()
{
    Assert.IsFalse(monster.WantsToGoLeft);
    Assert.IsTrue(monster.WantsToGoRight);
    Assert.IsFalse(monster.WantsToJump);
}
[Test]
public void CheckInitialTreasureDesiredMovement()
{
    Assert.IsFalse(treasure.WantsToGoLeft);
    Assert.IsFalse(treasure.WantsToGoRight);
    Assert.IsFalse(treasure.WantsToJump);
}
See Also