TouchPressTriggerTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Input.Tests TouchPressTriggerTests

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

public class TouchPressTriggerTests : TestWithMocksOrVisually

The TouchPressTriggerTests type exposes the following members.

Constructors

  NameDescription
Public methodTouchPressTriggerTests
Initializes a new instance of the TouchPressTriggerTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCreate
Public methodCreateFromAttributes
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 methodShowRedCircleOnTouch
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test, Category("Slow")]
public void ShowRedCircleOnTouch()
{
    new FontText(Font.Default, "Touch screen to show red circle", Rectangle.One);
    var ellipse = new Ellipse(new Rectangle(0.1f, 0.1f, 0.1f, 0.1f), Color.Red);
    new Command(() => ellipse.Center = Vector2D.Half).Add(new TouchPressTrigger(State.Pressed));
    new Command(() => ellipse.Center = Vector2D.Zero).Add(new TouchPressTrigger(State.Released));
} //ncrunch: no coverage end
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new TouchPressTrigger(State.Pressed);
    Assert.AreEqual(State.Pressed, trigger.State);
}
[Test, CloseAfterFirstFrame]
public void CreateFromAttributes()
{
    var trigger =
        new TouchPressTrigger(new Dictionary<string, string> { { "State", "Pressed" } });
See Also