Inheritance Hierarchy
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
The ActorTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ActorTests | Initializes a new instance of the ActorTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CheckColors | ||
CheckInitialMonsterDesiredMovement | ||
CheckInitialPlayerDesiredMovement | ||
CheckInitialTreasureDesiredMovement | ||
CheckMaxAcceleration | ||
CheckMaxFriction | ||
CheckMaxVelocityX | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetUp |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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