コード例 #1
0
        public void Start_RegistersCompanionInputHandler()
        {
            var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject));

            locomotion.Start();

            Assert.IsTrue(_inputBinder.IsHandlerOfTypeRegistered <CompanionInputHandler>());
        }
コード例 #2
0
        public void End_UnregistersGadgetInputHandler()
        {
            var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject));

            locomotion.Start();

            locomotion.End();

            Assert.IsTrue(_inputBinder.IsHandlerOfTypeUnregistered <GadgetInputHandler>());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        public void Created_HasLocomotionActionStateId()
        {
            var locomotion = new LocomotionActionState(new ActionStateInfo(_inputBinder.gameObject));

            Assert.AreEqual(EActionStateId.Locomotion, locomotion.ActionStateId);
        }