BoxMeshTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  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

public class BoxMeshTests : TestWithMocksOrVisually

The BoxMeshTests type exposes the following members.

Constructors

  NameDescription
Public methodBoxMeshTests
Initializes a new instance of the BoxMeshTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodChangeColor
Public methodChangeSize
Public methodCreateBox
Public methodDrawLitBox
Public methodDrawRedBox
Public methodDrawTexturedBox
Public methodDrawWith2DShaderIsNotAllowed
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
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