Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
TinyPlatformer.Tests MapTests
Namespace: TinyPlatformer.Tests
Assembly: TinyPlatformer.Tests (in TinyPlatformer.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The MapTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
MapTests | Initializes a new instance of the MapTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CheckEntityLoading | ||
CheckGetColor | ||
CheckMapContent | ||
CheckMapSize | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
MonsterKillAddsThreeToScore | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
ScoreStartsAtZero | ||
SetUp | ||
TreasureAddsOneToScore |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void CheckMapSize() { Assert.AreEqual(8, map.width); Assert.AreEqual(6, map.height); }
[Test, CloseAfterFirstFrame] public void CheckMapContent() { Assert.AreEqual(BlockType.LevelBorder, map.Blocks[0, 0]); Assert.AreEqual(BlockType.None, map.Blocks[1, 1]); }
[Test, CloseAfterFirstFrame] public void CheckEntityLoading() { Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "player").Count); Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "monster").Count); Assert.AreEqual(1, map.actorList.FindAll(actor => actor.type == "treasure").Count); }
[Test, CloseAfterFirstFrame] public void CheckGetColor() { Assert.AreEqual(Color.Gold, Map.GetColor(BlockType.Gold)); Assert.AreEqual(Color.Orange, Map.GetColor(BlockType.GroundBrick)); Assert.AreEqual(Color.Red, Map.GetColor(BlockType.PlatformBrick)); Assert.AreEqual(Color.Purple, Map.GetColor(BlockType.PlatformTop)); Assert.AreEqual(Color.Teal, Map.GetColor(BlockType.LevelBorder)); Assert.AreEqual(Color.TransparentBlack, Map.GetColor(BlockType.None)); }
[Test, CloseAfterFirstFrame] public void ScoreStartsAtZero() { Assert.AreEqual(0, map.score); Assert.AreEqual("Score: 0", map.scoreText.Text); }
[Test, CloseAfterFirstFrame] public void TreasureAddsOneToScore() { map.AddToScore("treasure"); Assert.AreEqual(1, map.score); Assert.AreEqual("Score: 1", map.scoreText.Text); }
[Test, CloseAfterFirstFrame] public void MonsterKillAddsThreeToScore() { map.AddToScore("monster"); Assert.AreEqual(3, map.score); Assert.AreEqual("Score: 3", map.scoreText.Text); }
See Also