Inheritance Hierarchy
DeltaEngine.Platforms TestWithMocksOrVisually
DeltaEngine.Rendering3D.Shapes.Tests BoxMeshTests
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 BoxMeshTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BoxMeshTests | Initializes a new instance of the BoxMeshTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
ChangeColor | ||
ChangeSize | ||
CreateBox | ||
DrawLitBox | ||
DrawRedBox | ||
DrawTexturedBox | ||
DrawWith2DShaderIsNotAllowed | ||
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 DrawLitBox() { new Model(new ModelData(new BoxMesh(Vector3D.One, new Material(ShaderFlags.LitTextured, "DeltaEngineLogo"))), Vector3D.Zero); }
[Test] public void DrawTexturedBox() { new Model(new ModelData(new BoxMesh(Vector3D.One, new Material(ShaderFlags.Textured, "DeltaEngineLogo"))), Vector3D.Zero); }
[Test] public void DrawRedBox() { new Model(new ModelData(new BoxMesh(Vector3D.One, Color.Red)), Vector3D.Zero); }
[Test, CloseAfterFirstFrame] public void DrawWith2DShaderIsNotAllowed() { Assert.Throws<ShaderWithFormat.ShaderFlagsNotSupported>( () => new BoxMesh(Vector3D.One, new Material(ShaderFlags.Position2DTextured, ""))); }
[Test, CloseAfterFirstFrame] public void CreateBox() { var box = new BoxMesh(Vector3D.UnitY, Color.Red); Assert.AreEqual(Vector3D.UnitY, box.Size); Assert.AreEqual(Color.Red, box.Color); Assert.AreEqual(8, box.Geometry.NumberOfVertices); Assert.AreEqual(36, box.Geometry.NumberOfIndices); Assert.AreEqual(VertexFormat.Position3DColor, (box.Material.Shader as ShaderWithFormat).Format); }
[Test, CloseAfterFirstFrame] public void ChangeSize() { var box = new BoxMesh(Vector3D.UnitX, Color.Red) { Size = Vector3D.UnitZ }; Assert.AreEqual(Vector3D.UnitZ, box.Size); }
[Test, CloseAfterFirstFrame] public void ChangeColor() { var box = new BoxMesh(Vector3D.UnitY, Color.Red) { Color = Color.Blue }; Assert.AreEqual(Color.Blue, box.Color); }
See Also