PlaneQuadTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering3D.Tests PlaneQuadTests

Namespace: DeltaEngine.Rendering3D.Tests
Assembly: DeltaEngine.Rendering3D.Tests (in DeltaEngine.Rendering3D.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class PlaneQuadTests : TestWithMocksOrVisually

The PlaneQuadTests type exposes the following members.

Constructors

  NameDescription
Public methodPlaneQuadTests
Initializes a new instance of the PlaneQuadTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodChangeSize
Public methodDrawFourPlanesWithoutCulling
Public methodDrawRedPlane
Public methodDrawUncoloredPlane
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.)
Public methodVerticesShouldNotBeWindedClockWise
Public methodWindingOfVerticesShouldBeCounterClockWise
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, ApproveFirstFrameScreenshot]
public void DrawRedPlane()
{
    SetUpCamera();
    new Model(new ModelData(CreatePlaneQuad()), Vector3D.Zero);
}
[Test, ApproveFirstFrameScreenshot]
public void DrawUncoloredPlane()
{
    SetUpCamera();
    new Model(new ModelData(CreateUncoloredPlaneQuad()), Vector3D.Zero);
}
[Test, ApproveFirstFrameScreenshot]
public void DrawFourPlanesWithoutCulling()
{
    Resolve<Device>().CullingMode = Culling.Disabled;
    SetUpCamera(-3);
    new Model(new ModelData(CreateUncoloredPlaneQuad()), Vector3D.Zero);
    new Model(new ModelData(CreatePlaneQuad(Color.Red)), Vector3D.UnitX * Size.Width);
    new Model(new ModelData(CreatePlaneQuad(Color.Green)), Vector3D.UnitY);
    new Model(new ModelData(CreatePlaneQuad(Color.Blue)), Vector3D.UnitZ * Size.Height);
}
[Test, CloseAfterFirstFrame]
public void ChangeSize()
{
    PlaneQuad quad = CreatePlaneQuad();
    Assert.AreEqual(Size, quad.Size);
    quad.Size = 2 * Size;
    Assert.AreEqual(2 * Size, quad.Size);
}
[Test, CloseAfterFirstFrame]
public void WindingOfVerticesShouldBeCounterClockWise()
{
    if (!StackTraceExtensions.IsStartedFromNCrunch())
        return; //ncrunch: no coverage
    MockGeometry geometry = CreateMockGeometry();
    var indices = new short[] { 0, 1, 2 };
    geometry.SetData(CreateVertexData(), indices);
    AssertVertices(geometry, indices);
    AssertGeometryIsCounterClockWise(geometry);
}
[Test, CloseAfterFirstFrame]
public void VerticesShouldNotBeWindedClockWise()
{
    if (!StackTraceExtensions.IsStartedFromNCrunch())
        return; //ncrunch: no coverage
    MockGeometry geometry = CreateMockGeometry();
    var indices = new short[] { 2, 1, 0 };
    geometry.SetData(CreateVertexData(), indices);
    AssertVertices(geometry, indices);
    AssertGeometryIsClockWise(geometry);
}
See Also