Unit tests for Brick
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
Blocks.Tests BrickTests
Namespace: Blocks.Tests
Assembly: Blocks.Tests (in Blocks.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The BrickTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BrickTests | Initializes a new instance of the BrickTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
Constants | ||
Constructor | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
Offset | ||
Position | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
RenderBrick | ||
RenderBrickInLandscapeMode | ||
RenderBrickInPortraitMode | ||
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetUp | ||
TopLeft |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test, CloseAfterFirstFrame] public void Constructor() { var brick = new Brick(material, Vector2D.Half, displayMode); Assert.AreEqual(Vector2D.Half, brick.Offset); }
[Test, CloseAfterFirstFrame] public void Constants() { Assert.AreEqual(new Vector2D(0.38f, 0.385f), Brick.OffsetLandscape); Assert.AreEqual(0.02f, Brick.ZoomLandscape); }
[Test, CloseAfterFirstFrame] public void Offset() { var brick = new Brick(material, Vector2D.Zero, displayMode) { Offset = Vector2D.Half }; Assert.AreEqual(Vector2D.Half, brick.Offset); }
[Test, CloseAfterFirstFrame] public void TopLeft() { var brick = new Brick(material, Vector2D.Zero, displayMode) { TopLeftGridCoord = Vector2D.Half }; Assert.AreEqual(Vector2D.Half, brick.TopLeftGridCoord); }
[Test, CloseAfterFirstFrame] public void Position() { var brick = new Brick(material, new Vector2D(0.1f, 0.2f), displayMode) { TopLeftGridCoord = new Vector2D(0.4f, 0.8f) }; Assert.AreEqual(new Vector2D(0.5f, 1.0f), brick.Position); }
[Test, CloseAfterFirstFrame] public void RenderBrick() { var brick = new Brick(material, new Vector2D(5, 5), displayMode); brick.UpdateDrawArea(); }
[Test] public void RenderBrickInLandscapeMode() { Resolve<Window>().ViewportPixelSize = new Size(600, 800); var brick = new Brick(material, new Vector2D(5, 5), Orientation.Landscape); brick.UpdateDrawArea(); }
[Test] public void RenderBrickInPortraitMode() { Resolve<Window>().ViewportPixelSize = new Size(600, 800); var brick = new Brick(material, new Vector2D(5, 5), Orientation.Portrait); brick.UpdateDrawArea(); }
See Also