예제 #1
0
        public void Update_CharacterDead_ReturnsCompleted()
        {
            _actionStateMachine.IsActionStateActiveResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Completed, goal.Update(1.9f));
        }
예제 #2
0
        public void Update_CanAttack_InProgress()
        {
            _attack.CanAttackResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.InProgress, goal.Update(1.9f));
        }
예제 #3
0
        public void Update_CanAttack_Attacks()
        {
            _attack.CanAttackResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.IsTrue(_attack.AttackCalled);
        }
예제 #4
0
        public void Update_CannotAttack_DoesNotAttack()
        {
            _attack.CanAttackResult = false;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.IsFalse(_attack.AttackCalled);
        }
예제 #5
0
        public void Update_QueriesIfCharacterDead()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.AreEqual(EActionStateMachineTrack.Locomotion, _actionStateMachine.IsActionStateActiveTrackQuery);
            Assert.AreEqual(EActionStateId.Dead, _actionStateMachine.IsActionStateActiveIdQuery);
        }
예제 #6
0
        public void Update_NoActionStateMachine_Fails()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, new GameObject());

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
예제 #7
0
        public void Update_NoAttackInterface_Fails()
        {
            var goal = new AttackTargetGoal(new GameObject(), _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
예제 #8
0
        public void Update_NoTarget_Fails()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, null);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
예제 #9
0
        public void Update_NoOwner_Fails()
        {
            var goal = new AttackTargetGoal(null, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }