Namespace: DeltaEngine.Commands
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Tests: DeltaEngine.Input.Tests.TouchPositionTriggerTests
Tests: DeltaEngine.Input.Tests.TouchDoubleTapTriggerTests
Tests: DeltaEngine.Input.Tests.TouchTapTriggerTests
1 unit tests call DeltaEngine.Commands.Trigger.Invoke
1 unit tests call DeltaEngine.Commands.Trigger.Invoke
1 unit tests call DeltaEngine.Commands.Trigger.Invoke
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax
Remarks
Remarks
Remarks
Examples
[Test] public void InvokeTouch() { var touch = Resolve<Touch>() as MockTouch; if (touch == null) return; //ncrunch: no coverage var trigger = new TouchPositionTrigger(State.Pressed); bool wasInvoked = false; new Command(() => wasInvoked = true).Add(trigger); touch.SetTouchState(0, State.Pressed, Vector2D.Half); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(wasInvoked); }
Examples
[Test] public void InvokeDoubleTap() { var touch = Resolve<Touch>() as MockTouch; if (touch == null) return; //ncrunch: no coverage var trigger = new TouchDoubleTapTrigger(); bool wasInvoked = false; new Command(() => wasInvoked = true).Add(trigger); touch.SetTouchState(0, State.Pressing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); touch.SetTouchState(0, State.Releasing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); touch.SetTouchState(0, State.Pressing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); touch.SetTouchState(0, State.Releasing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(wasInvoked); }
Examples
[Test] public void InvokeTouch() { var touch = Resolve<Touch>() as MockTouch; if (touch == null) return; //ncrunch: no coverage var trigger = new TouchTapTrigger(); bool wasInvoked = false; new Command(() => wasInvoked = true).Add(trigger); touch.SetTouchState(0, State.Pressing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); touch.SetTouchState(0, State.Releasing, Vector2D.Half); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(wasInvoked); }
See Also