RemoveOldestPointsTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering2D.Graphs.Tests RemoveOldestPointsTests

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

public class RemoveOldestPointsTests : TestWithMocksOrVisually

The RemoveOldestPointsTests type exposes the following members.

Constructors

  NameDescription
Public methodRemoveOldestPointsTests
Initializes a new instance of the RemoveOldestPointsTests class
Top
Methods

  NameDescription
Public methodAddingPointDoesNotRemoveFirstPointIfUnderTheLimit
Public methodAddingPointRemovesFirstPointIfOverTheLimit
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Public methodRenderTenPointRandomScrollingGraphOfDollars
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSetUp
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void RenderTenPointRandomScrollingGraphOfDollars()
{
    new FilledRect(Rectangle.One, Color.Gray) { RenderLayer = int.MinValue };
    graph.PercentilePrefix = "$";
    Assert.AreEqual(10, graph.MaximumNumberOfPoints);
    graph.Start<AddValueEverySecond>();
}
[Test, CloseAfterFirstFrame]
public void AddingPointDoesNotRemoveFirstPointIfUnderTheLimit()
{
    graph.MaximumNumberOfPoints = 3;
    line.AddPoint(new Vector2D(1, 0));
    line.AddPoint(new Vector2D(2, 0));
    Assert.AreEqual(2, line.points.Count);
    line.AddPoint(new Vector2D(3, 0));
    Assert.AreEqual(3, line.points.Count);
}
[Test, CloseAfterFirstFrame]
public void AddingPointRemovesFirstPointIfOverTheLimit()
{
    graph.MaximumNumberOfPoints = 3;
    line.AddPoint(new Vector2D(1, 0));
    line.AddPoint(new Vector2D(2, 0));
    line.AddPoint(new Vector2D(3, 0));
    Assert.AreEqual(3, line.points.Count);
    line.AddPoint(new Vector2D(4, 0));
    Assert.AreEqual(3, line.points.Count);
}
See Also