BoxTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering3D.Shapes.Tests BoxTests

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 BoxTests : TestWithMocksOrVisually

The BoxTests type exposes the following members.

Constructors

  NameDescription
Public methodBoxTests
Initializes a new instance of the BoxTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreateBoxWithTheModelData
Public methodCreateYellowBox
Public methodCreateYellowBoxInOtherPosition
Public methodDrawSeveralCubes
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 CreateYellowBox()
{
    var box = new Box(Vector3D.One, Color.Yellow);
    var mesh = (BoxMesh)box.Get<ModelData>().Meshes[0];
    Assert.AreEqual(Vector3D.One, mesh.Size);
}
[Test]
public void DrawSeveralCubes()
{
    CreateCubeOfColorAt(1.8f * Vector3D.One, Color.Gold);
    CreateCubeOfColorAt(Vector3D.One, Color.Orange);
    CreateCubeOfColorAt(0.2f * Vector3D.One, Color.Green);
    CreateCubeOfColorAt(-0.6f * Vector3D.One, Color.Red);
}
[Test, CloseAfterFirstFrame]
public void CreateYellowBoxInOtherPosition()
{
    var box = new Box(Vector3D.One, Color.Yellow, new Vector3D(0.5f, 0.0f, 0.0f));
    var mesh = (BoxMesh)box.Get<ModelData>().Meshes[0];
    Assert.AreEqual(new Vector3D(0.5f, 0.0f, 0.0f), box.Position);
}
[Test, CloseAfterFirstFrame]
public void CreateBoxWithTheModelData()
{
    var data = new ModelData(new BoxMesh(Vector3D.One, Color.Red));
    var box = new Box(data, Vector3D.Zero, Quaternion.Identity);
    var mesh = (BoxMesh)box.Get<ModelData>().Meshes[0];
    Assert.AreEqual(Vector3D.Zero, box.Position);
    Assert.AreEqual(Quaternion.Identity, box.Orientation);
    Assert.AreEqual(Color.Red, mesh.Color);
    Assert.AreEqual(Vector3D.One, mesh.Size);
}
See Also