public void InvokeTouch() { var touch = Resolve<MockTouch>(); 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); }
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); }