VectorTextTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering2D.Fonts.Tests VectorTextTests

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

public class VectorTextTests : TestWithMocksOrVisually

The VectorTextTests type exposes the following members.

Constructors

  NameDescription
Public methodVectorTextTests
Initializes a new instance of the VectorTextTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodChangeText
Public methodDrawBigText
Public methodDrawHi
Public methodDrawingTwoVectorTextsWithDifferentRenderLayersIssuesTwoDrawCalls
Public methodDrawingTwoVectorTextsWithTheSameRenderLayerOnlyIssuesOneDrawCall
Public methodDrawSampleText
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Public methodRenderingHiddenVectorTextDoesNotThrowException
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, ApproveFirstFrameScreenshot]
public void DrawHi()
{
    new VectorText("Hi", Vector2D.Half);
}
[Test, ApproveFirstFrameScreenshot]
public void DrawSampleText()
{
    new VectorText("The Quick Brown Fox...", Vector2D.Half) { Color = Color.Red };
    new VectorText("Jumps Over The Lazy Dog", new Vector2D(0.5f, 0.6f)) { Color = Color.Teal };
}
[Test, ApproveFirstFrameScreenshot]
public void DrawBigText()
{
    new VectorText("Yo yo, whats up", Vector2D.Half) { Size = new Size(0.1f) };
}
[Test, CloseAfterFirstFrame]
public void DrawingTwoVectorTextsWithTheSameRenderLayerOnlyIssuesOneDrawCall()
{
    new VectorText("Yo yo, whats up", Vector2D.Half) { Size = new Size(0.1f) };
    new VectorText("Jumps Over The Lazy Dog", new Vector2D(0.5f, 0.6f)) { Color = Color.Teal };
    RunAfterFirstFrame(
        () => Assert.AreEqual(1, Resolve<Drawing>().NumberOfDynamicDrawCallsThisFrame));
}
[Test, CloseAfterFirstFrame]
public void DrawingTwoVectorTextsWithDifferentRenderLayersIssuesTwoDrawCalls()
{
    new VectorText("Yo yo, whats up", Vector2D.Half) { Size = new Size(0.1f), RenderLayer = 1 };
    new VectorText("Jumps Over The Lazy Dog", Vector2D.One) { Color = Color.Teal, RenderLayer = 2 };
    RunAfterFirstFrame(
        () => Assert.AreEqual(2, Resolve<Drawing>().NumberOfDynamicDrawCallsThisFrame));
}
[Test, CloseAfterFirstFrame]
public void RenderingHiddenVectorTextDoesNotThrowException()
{
    new VectorText("The Quick Brown Fox...", Vector2D.Half) { IsVisible = false };
    Assert.DoesNotThrow(() => AdvanceTimeAndUpdateEntities());
}
[Test, ApproveFirstFrameScreenshot]
public void ChangeText()
{
    var text = new VectorText("Unchanged", Vector2D.Half) { Text = "Changed" };
    Assert.AreEqual("Changed", text.Text);
}
See Also