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