TouchPositionTriggerTests InvokeTouch Method Delta Engine Documentation

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

public void InvokeTouch()
Examples

[Test]
public void InvokeTouch()
{
    var touch = Resolve<Touch>() as MockTouch;
    if (touch == null)
        return; //ncrunch: no coverage 
    var trigger = new TouchPositionTrigger(State.Pressed);
    bool wasInvoked = false;
    new Command(() => wasInvoked = true).Add(trigger);
    touch.SetTouchState(0, State.Pressed, Vector2D.Half);
    AdvanceTimeAndUpdateEntities();
    Assert.IsTrue(wasInvoked);
}
See Also