public void PauseInputKeyReleased_TimeService_DoesNotToggle() { _inputHandler = new PauseInputHandler(_timeService); _inputHandler.HandleButtonInput(EInputKey.TogglePause, false); Assert.IsNull(_timeService.SetPauseStatusResult); }
public void PauseInputKeyPressed_TimeServiceUnpaused_TogglesPause() { _inputHandler = new PauseInputHandler(_timeService); _timeService.GetPauseStatusResult = EPauseStatus.Unpaused; _inputHandler.HandleButtonInput(EInputKey.TogglePause, true); Assert.AreEqual(EPauseStatus.Paused, _timeService.SetPauseStatusResult); }
private void RegisterForInput(CharacterComponent inCharacter) { _locomotionInputHandler = new LocomotionInputHandler(Info.Owner.GetComponent <IMovementInterface>(), inCharacter.ActiveController.GetComponent <IPlayerCameraInterface>(), Info.Owner.GetComponent <IHeldItemInterface>()); _interactionInputHandler = new InteractionInputHandler(Info.Owner.GetComponent <IInteractionInterface>()); _pauseInputHandler = new PauseInputHandler(GameServiceProvider.CurrentInstance.GetService <ITimeServiceInterface>()); _companionInputHandler = new CompanionInputHandler(Info.Owner.GetComponent <ICompanionSetInterface>()); _gadgetInputHandler = new GadgetInputHandler(Info.Owner.GetComponent <IGadgetSetInterface>()); _inputBinderInterface = Info.Owner.GetComponent <IInputBinderInterface>(); if (_inputBinderInterface != null) { _inputBinderInterface.RegisterInputHandler(_gadgetInputHandler); _inputBinderInterface.RegisterInputHandler(_companionInputHandler); _inputBinderInterface.RegisterInputHandler(_pauseInputHandler); _inputBinderInterface.RegisterInputHandler(_interactionInputHandler); _inputBinderInterface.RegisterInputHandler(_locomotionInputHandler); } }
public void PauseInputKeyPressed_TimeService_Handled() { _inputHandler = new PauseInputHandler(_timeService); Assert.AreEqual(EInputHandlerResult.Handled, _inputHandler.HandleButtonInput(EInputKey.TogglePause, true)); }