Skip to content

Commit 7124a9c

Browse files
committed
Expanding alignment tests to be universal between all handle types
1 parent 65f04bf commit 7124a9c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Assets/MRTK/Tests/PlayModeTests/BoundsControlTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,22 +2088,23 @@ public IEnumerator PerAxisHandlePrefabTest([ValueSource("perAxisHandleTestData")
20882088
/// Test for verifying automatically generated handle colliders are properly aligned to the handle visual
20892089
/// </summary>
20902090
[UnityTest]
2091-
public IEnumerator PerAxisHandleAlignmentTest([ValueSource("perAxisHandleTestData")] PerAxisHandleTestData testData)
2091+
public IEnumerator HandleAlignmentTest([ValueSource("handleTestData")] HandleTestData testData)
20922092
{
20932093
var boundsControl = InstantiateSceneAndDefaultBoundsControl();
20942094
yield return VerifyInitialBoundsCorrect(boundsControl);
20952095

20962096
// Create an oblong-shaped handle
20972097
// (cylinder primitive will do, as it is longer than it is wide!)
2098+
// Testing oblong handles will stress the alignment/rotation behavior
20982099
var cylinder = GameObject.CreatePrimitive(PrimitiveType.Cylinder);
20992100
GameObject.Destroy(cylinder.GetComponent<CapsuleCollider>());
21002101

21012102
// Wait for Destroy() to do its thing
21022103
yield return null;
21032104

2104-
// Set the rotation handles to be cylinders!
2105+
// Set the handles to be cylinders!
21052106
System.Reflection.PropertyInfo propName = boundsControl.GetType().GetProperty(testData.configPropertyName);
2106-
PerAxisHandlesConfiguration config = (PerAxisHandlesConfiguration)propName.GetValue(boundsControl);
2107+
HandlesBaseConfiguration config = (HandlesBaseConfiguration)propName.GetValue(boundsControl);
21072108
config.HandlePrefab = cylinder;
21082109

21092110
// Reflection voodoo to retrieve the ColliderPadding value regardless of which

0 commit comments

Comments
 (0)