MouseDragDropTriggerTests DragDropOutsideStartArea 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 DragDropOutsideStartArea()
Examples

[Test, CloseAfterFirstFrame]
public void DragDropOutsideStartArea()
{
    if (mouse == null)
        return; //ncrunch: no coverage
    Vector2D startPoint = -Vector2D.One;
    new Command(position => { startPoint = position; }).Add(
        new MouseDragDropTrigger(Rectangle.HalfCentered, MouseButton.Left));
    SetMouseState(State.Pressing, Vector2D.Zero);
    SetMouseState(State.Pressed, Vector2D.One);
    SetMouseState(State.Releasing, Vector2D.One);
    SetMouseState(State.Released, Vector2D.One);
    Assert.AreEqual(-Vector2D.One, startPoint);
}
See Also