mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 14:08:48 +00:00
fix(test): fix malformed test
The child was not being assigned a new parent, causing GetComponentsInChildrenOnly to return empty array and the subsequent line: Assert.That(components, Has.Length.EqualTo(1)); was resulting in a test fail.
This commit is contained in:
parent
f4d6c9083b
commit
98cd96d5cb
@ -17,6 +17,7 @@ namespace X10D.Unity.Tests
|
|||||||
var rigidbody = parent.AddComponent<Rigidbody>();
|
var rigidbody = parent.AddComponent<Rigidbody>();
|
||||||
|
|
||||||
var child = new GameObject();
|
var child = new GameObject();
|
||||||
|
child.transform.SetParent(parent.transform);
|
||||||
child.AddComponent<Rigidbody>();
|
child.AddComponent<Rigidbody>();
|
||||||
|
|
||||||
Rigidbody[] components = rigidbody.GetComponentsInChildrenOnly<Rigidbody>();
|
Rigidbody[] components = rigidbody.GetComponentsInChildrenOnly<Rigidbody>();
|
||||||
|
Loading…
Reference in New Issue
Block a user