public void Start_RegistersCompanionInputHandler() { var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject)); locomotion.Start(); Assert.IsTrue(_inputBinder.IsHandlerOfTypeRegistered <CompanionInputHandler>()); }
public void End_UnregistersGadgetInputHandler() { var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject)); locomotion.Start(); locomotion.End(); Assert.IsTrue(_inputBinder.IsHandlerOfTypeUnregistered <GadgetInputHandler>()); }
public void Start_SendsEnterLocomotionStateMessage() { var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject)); var messageSpy = new UnityTestMessageHandleResponseObject <EnterLocomotionStateMessage>(); var handle = UnityMessageEventFunctions.RegisterActionWithDispatcher <EnterLocomotionStateMessage>( _characterComponent.gameObject, messageSpy.OnResponse); locomotion.Start(); Assert.IsTrue(messageSpy.ActionCalled); UnityMessageEventFunctions.UnregisterActionWithDispatcher(_characterComponent.gameObject, handle); }