public void GetHierarchyStatusMessage_WhenRoot_MessageNullOrEmpty() { CreateHierarchy(Array.Empty <Type>(), Array.Empty <Type>(), Array.Empty <Type>()); StatusMessageUtility.GetHierarchyStatusMessage(new[] { Root.transform }, out var msg); Assert.That(msg, Is.Null.Or.Empty); }
public MessageType GetMatrixStatusMessage_WithStateCombination_MessageContainsExpectedKeywords( IReadOnlyList <MatrixState> matrixStates, string keywords ) { var result = StatusMessageUtility.GetMatrixStatusMessage(matrixStates, out var message); Assert.That(message, Does.Match(keywords)); return(result); }
public void GetHierarchyStatusMessage_WhenChild_AndChildIsPrimaryBody_MessageNotNullOrEmpty( [Values(typeof(PhysicsBodyAuthoring), typeof(PhysicsShapeAuthoring), typeof(PxBox), typeof(PxCapsule), typeof(PxMesh), typeof(PxSphere), typeof(Rigidbody))] Type childComponentType ) { CreateHierarchy(Array.Empty <Type>(), Array.Empty <Type>(), new[] { childComponentType }); Assume.That(PhysicsShapeExtensions.GetPrimaryBody(Child), Is.EqualTo(Child)); StatusMessageUtility.GetHierarchyStatusMessage(new[] { Child.GetComponent(childComponentType) }, out var msg); Assert.That(msg, Is.Not.Null.Or.Empty); }
public void GetHierarchyStatusMessage_WhenChild_AndChildHasBodyAndShape_QueryingBodyReturnsMessage( [Values( #if LEGACY_PHYSICS typeof(LegacyRigidBody), #endif typeof(PhysicsBodyAuthoring) )] Type bodyType, [Values( #if LEGACY_PHYSICS typeof(LegacyBox), typeof(LegacyCapsule), typeof(LegacyMesh), typeof(LegacySphere), #endif typeof(PhysicsShapeAuthoring) )] Type shapeType ) { CreateHierarchy(Array.Empty <Type>(), Array.Empty <Type>(), new[] { bodyType, shapeType }); Assume.That(PhysicsShapeExtensions.GetPrimaryBody(Child), Is.EqualTo(Child)); StatusMessageUtility.GetHierarchyStatusMessage(new[] { Child.GetComponent(bodyType) }, out var msg); Assert.That(msg, Is.Not.Null.Or.Empty); }
public void GetHierarchyStatusMessage_WhenChild_AndChildIsNotPrimaryBody_MessageNullOrEmpty( [Values( #if LEGACY_PHYSICS typeof(LegacyRigidBody), typeof(LegacyBox), #endif typeof(PhysicsBodyAuthoring), typeof(PhysicsShapeAuthoring) )] Type parentComponentType, [Values( #if LEGACY_PHYSICS typeof(LegacyBox), typeof(LegacyCapsule), typeof(LegacyMesh), typeof(LegacySphere), #endif typeof(PhysicsShapeAuthoring) )] Type childComponentType ) { CreateHierarchy(Array.Empty <Type>(), new[] { parentComponentType }, new[] { childComponentType }); Assume.That(PhysicsShapeExtensions.GetPrimaryBody(Child), Is.EqualTo(Parent)); StatusMessageUtility.GetHierarchyStatusMessage(new[] { Child.GetComponent(childComponentType) }, out var msg); Assert.That(msg, Is.Null.Or.Empty); }