Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Rendering2D.Shapes.Tests Grid2DTests
Namespace: DeltaEngine.Rendering2D.Shapes.Tests
Assembly: DeltaEngine.Rendering2D.Shapes.Tests (in DeltaEngine.Rendering2D.Shapes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Grid2DTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Grid2DTests | Initializes a new instance of the Grid2DTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
ChangeDimensionAndScale | ||
Dispose2DCamera | ||
InactivatingInactivatesLines | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
RenderQuadraticGridWithSizeOfOne | ||
RenderQuadraticGridWithSizeOfTen | ||
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
Setup2DCamera | ||
TestDrawAreaOfGrid |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void RenderQuadraticGridWithSizeOfOne() { var grid = new Grid2D(new Size(2), Vector2D.Half); AssertQuadraticGrid(2, grid); foreach (var line in grid.lines) Assert.IsTrue(line.IsActive); }
[Test] public void RenderQuadraticGridWithSizeOfTen() { var grid = new Grid2D(new Size(10), Vector2D.Half, 0.05f); AssertQuadraticGrid(10, grid); }
[Test, CloseAfterFirstFrame] public void InactivatingInactivatesLines() { var grid = new Grid2D(new Size(2), Vector2D.Half); grid.IsActive = false; foreach (var line in grid.lines) Assert.IsFalse(line.IsActive); }
[Test, CloseAfterFirstFrame] public void ChangeDimensionAndScale() { var grid = new Grid2D(new Size(2), Vector2D.Half); grid.Dimension = new Size(4); grid.GridScale = 2; Assert.AreEqual(2, grid.GridScale); }
[Test, CloseAfterFirstFrame] public void TestDrawAreaOfGrid() { var grid = new Grid2D(new Size(10), Vector2D.Half, 0.05f); var exceptedTopLeft = new Vector2D(0.25f, 0.25f); var exceptedBottomRight = new Vector2D(0.75f, 0.75f); Assert.AreEqual(Rectangle.FromCorners(exceptedTopLeft, exceptedBottomRight), grid.DrawArea); }
See Also