public void AIMoveInput_ReadInputWithNoTarget_DoNothing() { moveInput = new AIMoveInput(objectTransform, null); float expectedResultX = 0f; float expectedResultY = 0f; moveInput.ReadInput(); Assert.AreEqual(expectedResultX, moveInput.HorizontalInput, 0.05f); Assert.AreEqual(expectedResultY, moveInput.VerticalInput, 0.05f); }
public void AIMoveInput_ReadInput_GetDirectionToTarget() { targetTransform.position = new Vector3(5f, 0f, 5f); moveInput = new AIMoveInput(objectTransform, targetTransform); float expectedResultX = 0.7f; float expectedResultY = 0.7f; moveInput.ReadInput(); Assert.AreEqual(expectedResultX, moveInput.HorizontalInput, 0.05f); Assert.AreEqual(expectedResultY, moveInput.VerticalInput, 0.05f); }