TouchDragDropTriggerTests DragDropCloseToStartPointWillDoNothing 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 DragDropCloseToStartPointWillDoNothing()
Examples

    [Test, CloseAfterFirstFrame]
    public void DragDropCloseToStartPointWillDoNothing()
    {
        if (touch == null)
            return; //ncrunch: no coverage
        Vector2D startPoint = -Vector2D.One;
        new Command(position => //ncrunch: no coverage start
            { startPoint = position; }).Add(new TouchDragDropTrigger(Rectangle.HalfCentered));
        //ncrunch: no coverage end
        SetTouchState(State.Pressing, Vector2D.Half);
        SetTouchState(State.Pressed, Vector2D.Half);
        SetTouchState(State.Releasing, Vector2D.Half);
        Assert.AreEqual(-Vector2D.One, startPoint);
    }

    [Test, CloseAfterFirstFrame]
    public void CreateTouchDragDropTriggerFromString()
    {
        var startArea = Rectangle.One;
        var trigger = new TouchDragDropTrigger(new Dictionary<string, string>
            { { "StartArea", startArea.ToString() } });
        Assert.AreEqual(startArea, trigger.StartArea);
    }
}
See Also