Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Rendering3D.Shapes.Tests Grid3DTests
Namespace: DeltaEngine.Rendering3D.Shapes.Tests
Assembly: DeltaEngine.Rendering3D.Shapes.Tests (in DeltaEngine.Rendering3D.Shapes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Grid3DTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Grid3DTests | Initializes a new instance of the Grid3DTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
CheckGridDimension | ||
CheckGridScale | ||
InactivatingInactivatesLines | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RedrawGridIfItChanges | ||
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
RenderGridWithCenterInOtherPosition | ||
RenderQuadraticGridWithSizeOfOne | ||
RenderQuadraticGridWithSizeOfTen | ||
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) | |
SetupCameraFortyFiveDegreesView | ||
UpdateCenterOfGrid |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
Examples
[Test] public void RenderQuadraticGridWithSizeOfOne() { var grid = CreateQuadraticGrid(1); new Line3D(Vector3D.Zero, Vector3D.UnitZ, Color.Red); AssertQuadraticGrid(1, grid); foreach (var line in grid.lines) Assert.IsTrue(line.IsActive); }
[Test] public void RenderQuadraticGridWithSizeOfTen() { var grid = CreateQuadraticGrid(10); AssertQuadraticGrid(10, grid); }
[Test, CloseAfterFirstFrame] public void InactivatingInactivatesLines() { var grid = CreateQuadraticGrid(2); grid.IsActive = false; foreach (var line in grid.lines) Assert.IsFalse(line.IsActive); }
[Test] public void CheckGridScale() { var grid = CreateQuadraticGrid(10); Assert.AreEqual(0.2f, grid.GridScale); grid.GridScale = 1.0f; Assert.AreEqual(1.0f, grid.GridScale); }
[Test] public void CheckGridDimension() { var grid = CreateQuadraticGrid(10); Assert.AreEqual(new Size(10, 10), grid.Dimension); grid.Dimension = new Size(20, 20); Assert.AreEqual(new Size(20, 20), grid.Dimension); }
[Test] public void RenderGridWithCenterInOtherPosition() { var grid = new Grid3D(new Vector3D(5, 5, 0), new Size(1)); new Line3D(Vector3D.Zero, Vector3D.UnitX, Color.Red); new Line3D(Vector3D.Zero, Vector3D.UnitY, Color.Green); new Line3D(Vector3D.Zero, Vector3D.UnitZ, Color.Blue); AssertQuadraticGrid(1, grid); new Line3D(new Vector3D(5, 5, 0), new Vector3D(5, 5, 1), Color.Blue); foreach (var line in grid.lines) Assert.IsTrue(line.IsActive); Assert.AreEqual(new Vector3D(5, 5, 0), grid.Position); }
[Test] public void RedrawGridIfItChanges() { var grid = new Grid3D(new Size(1)); Assert.AreEqual(4, EntitiesRunner.Current.GetEntitiesOfType<Line3D>().Count); grid.Dimension = new Size(10); Assert.AreEqual(22, EntitiesRunner.Current.GetEntitiesOfType<Line3D>().Count); }
[Test] public void UpdateCenterOfGrid() { var grid = new Grid3D(new Size(1)); Assert.AreEqual(Vector3D.Zero, grid.Position); grid.Position = new Vector3D(1, 1, 0); Assert.AreEqual(4, EntitiesRunner.Current.GetEntitiesOfType<Line3D>().Count); Assert.AreEqual(new Vector3D(1, 1, 0), grid.Position); }
See Also