TimeTriggerTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.GameLogic.Tests TimeTriggerTests

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

public class TimeTriggerTests : TestWithMocksOrVisually

The TimeTriggerTests type exposes the following members.

Constructors

  NameDescription
Public methodTimeTriggerTests
Initializes a new instance of the TimeTriggerTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
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 methodTestTimeTrigger
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, CloseAfterFirstFrame]
public void TestTimeTrigger()
{
    var actor = new MockActor(Vector3D.Zero, 0.0f);
    var data = new TimeTrigger.Data(Color.Red, Color.Green, 1.0f);
    actor.Add(data);
    actor.Start<TimeTrigger>();
    actor.Add(Color.Black);
    Assert.AreEqual(Color.Black, actor.Get<Color>());
    Assert.AreEqual(Color.Red, data.FirstColor);
    Assert.AreEqual(Color.Green, data.SecondColor);
    Assert.AreEqual(1.0f, data.Interval);
    AdvanceTimeAndUpdateEntities(1.1f);
    Assert.AreEqual(Color.Red, actor.Get<Color>());
}
See Also