public void Update_CharacterDead_ReturnsCompleted() { _actionStateMachine.IsActionStateActiveResult = true; var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject); Assert.AreEqual(EGoalStatus.Completed, goal.Update(1.9f)); }
public void Update_CanAttack_InProgress() { _attack.CanAttackResult = true; var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject); Assert.AreEqual(EGoalStatus.InProgress, goal.Update(1.9f)); }
public void Update_CanAttack_Attacks() { _attack.CanAttackResult = true; var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject); goal.Update(1.0f); Assert.IsTrue(_attack.AttackCalled); }
public void Update_CannotAttack_DoesNotAttack() { _attack.CanAttackResult = false; var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject); goal.Update(1.0f); Assert.IsFalse(_attack.AttackCalled); }
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); }
public void Update_NoActionStateMachine_Fails() { var goal = new AttackTargetGoal(_attack.gameObject, new GameObject()); Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f)); }
public void Update_NoAttackInterface_Fails() { var goal = new AttackTargetGoal(new GameObject(), _actionStateMachine.gameObject); Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f)); }
public void Update_NoTarget_Fails() { var goal = new AttackTargetGoal(_attack.gameObject, null); Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f)); }
public void Update_NoOwner_Fails() { var goal = new AttackTargetGoal(null, _actionStateMachine.gameObject); Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f)); }