Namespace: DeltaEngine.Input.Tests
Assembly: DeltaEngine.Input.Tests (in DeltaEngine.Input.Tests.dll) Version: 1.1.1.0 (1.1.1)
Assembly: DeltaEngine.Input.Tests (in DeltaEngine.Input.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Examples
[Test, CloseAfterFirstFrame] public void FlickDetection() { var trigger = new TouchFlickTrigger(); var touch = Resolve<Touch>() as MockTouch; if (touch == null) return; //ncrunch: no coverage bool flickHappened = false; trigger.Invoked += () => flickHappened = true; AdvanceTouchTick(touch, State.Pressing, new Vector2D(0.5f, 0.5f), trigger); Assert.IsFalse(flickHappened); Assert.AreEqual(0, trigger.PressTime); AdvanceTouchTick(touch, State.Pressed, new Vector2D(0.52f, 0.5f), trigger); Assert.IsFalse(flickHappened); AdvanceTouchTick(touch, State.Releasing, new Vector2D(0.6f, 0.5f), trigger); Assert.IsTrue(flickHappened); Assert.AreEqual(new Vector2D(0.5f, 0.5f), trigger.StartPosition); }
See Also