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

[Test, CloseAfterFirstFrame]
public void Create()
{
    var trigger = new TouchDragDropTrigger(Rectangle.One);
    Assert.AreEqual(Rectangle.One, trigger.StartArea);
    Assert.AreEqual(Vector2D.Unused, trigger.StartDragPosition);
}
[Test, CloseAfterFirstFrame]
public void CreateFromAttributes()
{
    var trigger = new TouchDragDropTrigger(new Dictionary<string, string>
        {
            { "StartArea", new Rectangle(0.1f, 0.2f, 0.3f, 0.4f).ToString() }
        });
    Assert.AreEqual(new Rectangle(0.1f, 0.2f, 0.3f, 0.4f), trigger.StartArea);
    Assert.AreEqual(Vector2D.Unused, trigger.StartDragPosition);
}
[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