Namespace: DeltaEngine.Input
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Input.Tests.MouseFlickTriggerTests
1 unit tests call DeltaEngine.Input.MouseFlickTrigger.PressTime
Assembly: DeltaEngine.Input (in DeltaEngine.Input.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Property Value
Type: SingleRemarks
Examples
[Test] public void FlickWithMouse() { var trigger = new MouseFlickTrigger(); var mouse = Resolve<Mouse>() as MockMouse; if (mouse == null) return; //ncrunch: no coverage bool flickHappened = false; trigger.Invoked += () => flickHappened = true; AdvanceMouseTick(mouse, State.Pressing, new Vector2D(0.5f, 0.5f)); Assert.IsFalse(flickHappened); Assert.AreEqual(0.0f, trigger.PressTime); Assert.AreEqual(new Vector2D(0.5f, 0.5f), trigger.StartPosition); AdvanceMouseTick(mouse, State.Pressed, new Vector2D(0.52f, 0.5f)); Assert.IsFalse(flickHappened); AdvanceMouseTick(mouse, State.Releasing, new Vector2D(0.8f, 0.8f)); Assert.IsTrue(flickHappened); Assert.AreEqual(new Vector2D(0.5f, 0.5f), trigger.StartPosition); }
See Also