TouchDualDragTriggerTests ClassDelta Engine Documentation
Inheritance Hierarchy

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

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

public class TouchDualDragTriggerTests : TestWithMocksOrVisually

The TouchDualDragTriggerTests type exposes the following members.

Constructors

  NameDescription
Public methodTouchDualDragTriggerTests
Initializes a new instance of the TouchDualDragTriggerTests class
Top
Methods

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

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void DragTouchToCreateRectangles()
{
    MouseDragTriggerTests.DragToCreateRectangles(new TouchDualDragTrigger());
}
[Test, CloseAfterFirstFrame]
public void DragTouch()
{
    var touch = Resolve<Touch>() as MockTouch;
    if (touch == null)
        return; //ncrunch: no coverage 
    bool isFinished = false;
    new Command((start, end, done) => isFinished = done).Add(new TouchDualDragTrigger());
    SetTouchState(touch, State.Pressing, Vector2D.Zero);
    SetTouchState(touch, State.Pressed, Vector2D.One);
    SetTouchState(touch, State.Releasing, Vector2D.One);
    Assert.IsTrue(isFinished);
}
[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new TouchDualDragTrigger();
    Assert.AreEqual(DragDirection.Free, trigger.Direction);
    trigger =
        new TouchDualDragTrigger(new Dictionary<string, string> { { "Direction", "Horizontal" } });
See Also