Inheritance Hierarchy
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
The VectorTextTests type exposes the following members.
Constructors
Name | Description | |
---|---|---|
VectorTextTests | Initializes a new instance of the VectorTextTests class |
Methods
Name | Description | |
---|---|---|
AdvanceTimeAndUpdateEntities | (Inherited from TestWithMocksOrVisually.) | |
ChangeText | ||
DrawBigText | ||
DrawHi | ||
DrawingTwoVectorTextsWithDifferentRenderLayersIssuesTwoDrawCalls | ||
DrawingTwoVectorTextsWithTheSameRenderLayerOnlyIssuesOneDrawCall | ||
DrawSampleText | ||
InitializeResolver | (Inherited from TestWithMocksOrVisually.) | |
RegisterMock T | (Inherited from TestWithMocksOrVisually.) | |
RenderingHiddenVectorTextDoesNotThrowException | ||
Resolve T | (Inherited from TestWithMocksOrVisually.) | |
RunAfterFirstFrame | (Inherited from TestWithMocksOrVisually.) | |
RunTestAndDisposeResolverWhenDone | (Inherited from TestWithMocksOrVisually.) |
Properties
Name | Description | |
---|---|---|
IsMockResolver | (Inherited from TestWithMocksOrVisually.) |
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