Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
Snake.Tests ChunkTests
Namespace: Snake.Tests
Assembly: Snake.Tests (in Snake.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The ChunkTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
ChunkTests | Initializes a new instance of the ChunkTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CheckChunkSpawnWithinSnakeBody | ||
CreateFirstChunk | ||
DrawChunkAtRandomLocation | ||
Init | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void CreateFirstChunk() { var chunk = new Chunk(gridSize, blockSize, Color.Purple); Assert.IsTrue(chunk.IsActive); Assert.AreEqual(blockSize, chunk.Size.Width); Assert.AreEqual(blockSize, chunk.Size.Height); Assert.AreEqual(Color.Purple, chunk.Color); Assert.LessOrEqual(0.0f, chunk.DrawArea.Left); Assert.LessOrEqual(0.0f, chunk.DrawArea.Top); Assert.GreaterOrEqual(1.0f, chunk.DrawArea.Left); Assert.GreaterOrEqual(1.0f, chunk.DrawArea.Top); }
[Test] public void DrawChunkAtRandomLocation() { Resolve<Window>().ViewportPixelSize = new Size(800, 600); var smallChunk = new Chunk(gridSize, blockSize, Color.Purple); smallChunk.SpawnAtRandomLocation(); }
[Test] public void CheckChunkSpawnWithinSnakeBody() { Resolve<Window>().ViewportPixelSize = new Size(200, 200); new Snake(gridSize, Color.Green); new Chunk(gridSize, blockSize, Color.Purple); }
See Also