public void ReceiveButtonEvent_ExecutesThroughHandler() { var firstHandler = new InputBinderTestInputHandler(EInputHandlerResult.Handled); _inputBinderComponent.RegisterInputHandler(firstHandler); _inputBinderComponent.SetInputInterface(_inputInterface); _inputInterface.TestActivateButtonEvent(InputBinderTestInputHandler.InputKeyToUse, false); Assert.IsTrue(firstHandler.ReceivedResponse); }
public void UnregisterHandler_DoesNotReceiveResponse() { var handler = new InputBinderTestInputHandler(EInputHandlerResult.Handled); _inputBinderComponent.RegisterInputHandler(handler); _inputBinderComponent.SetInputInterface(_inputInterface); _inputBinderComponent.UnregisterInputHandler(handler); _inputInterface.TestActivateMouseEvent(InputBinderTestInputHandler.InputKeyToUse, new Vector3()); Assert.IsFalse(handler.ReceivedResponse); }
public void ReceiveButtonEvent_ExecutesUntilResponseHandled() { var firstHandler = new InputBinderTestInputHandler(EInputHandlerResult.Unhandled); var secondHandler = new InputBinderTestInputHandler(EInputHandlerResult.Handled); var thirdHandler = new InputBinderTestInputHandler(EInputHandlerResult.Unhandled); _inputBinderComponent.RegisterInputHandler(firstHandler); _inputBinderComponent.RegisterInputHandler(secondHandler); _inputBinderComponent.RegisterInputHandler(thirdHandler); _inputBinderComponent.SetInputInterface(_inputInterface); _inputInterface.TestActivateButtonEvent(InputBinderTestInputHandler.InputKeyToUse, false); Assert.IsTrue(thirdHandler.ReceivedResponse); Assert.IsTrue(secondHandler.ReceivedResponse); Assert.IsFalse(firstHandler.ReceivedResponse); }